nginx 访问静态文件404错误
可能原因:
1、文件路径不对
2、nginx未重启
3、路径冲突 ,优先级(详读:nginx location规则以及优先级详解) 如以下配置
- server {
- listen 80;
- server_name localhost;
-
- location / {
- proxy_pass http://epos/;
- proxy_redirect default;
- }
-
-
- location /www {
- root D:/Program File/apache-tomcat-9.0.45/webapps/ROOT;
- index index.html index.htm;
- }
-
- error_page 500 502 503 504 /50x.html;
- location = /50x.html {
- root html;
- }
-
-
- }
/www 会一直访问失败