Heim  >  Fragen und Antworten  >  Hauptteil

Probleme mit der Konfiguration mehrerer Nginx-Verzeichnisse

location = /static {
    root "C:\Users\****\Desktop\cx\www";
}
location = /admin {
    alias "C:\Users\****\Desktop\cx-admin\app";
}
location /{...}

App ist ein statisches Dateiverzeichnis.
Ich hoffe, dass der Zugriff auf /admin dem Zugriff auf das App-Verzeichnis entspricht.
Und wenn Sie auf admin/ zugreifen, greifen Sie auf app/index.html zu, ohne es neu zu schreiben.
So ändern Sie es.

PHPzPHPz2714 Tage vor432

Antworte allen(1)Ich werde antworten

  • ringa_lee

    ringa_lee2017-05-16 17:12:10

    location /static {
            alias C:\Users\****\Desktop\cx\www\static/;
            etag         on;
            expires      max;
            access_log off;
        }
        location /admin {
            alias C:\Users\****\Desktop\cx-admin\dist/;
            etag         on;
            expires      max;
        }
        location / {
        ...

    Antwort
    0
  • StornierenAntwort