Probleme mit der Konfiguration mehrerer Nginx-Verzeichnisse
PHPz
PHPz 2017-05-16 17:10:10
0
1
423
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.

PHPz
PHPz

学习是最好的投资!

Antworte allen(1)
左手右手慢动作
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 / {
    ...
Beliebte Tutorials
Mehr>
Neueste Downloads
Mehr>
Web-Effekte
Quellcode der Website
Website-Materialien
Frontend-Vorlage
Über uns Haftungsausschluss Sitemap
Chinesische PHP-Website:Online-PHP-Schulung für das Gemeinwohl,Helfen Sie PHP-Lernenden, sich schnell weiterzuentwickeln!