我使用nginx和多个nodejs应用程序设置了vps。在此应用程序上,某些图像未加载。总是有相同的文件。它们都是小写字母,并具有755权限。
Nginx配置:
server {
server_name jakubdev.pl www.jakubdev.pl;
location '/.well-known/acme-challenge' {
default_type "text/plain";
root /var/www/portfolio;
}
location / {
proxy_read_timeout 300;
proxy_connect_timeout 300;
proxy_redirect off;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Frame-Options SAMEORIGIN;
proxy_pass http://127.0.0.1:3000;
}
location /images/ {
root /var/www/portfolio/public;
add_header Cache-control "public";
access_log off;
expires 90d;
autoindex on;
autoindex_exact_size off;
}
错误日志:
2019/04/13 16:19:19 [error] 20380#20380: *7 open() "/var/www/portfolio/public/images/icons/iphone/iphone-x.png" failed (2: No such file or directory), client: 83.28.244.168, server: jakubdev.pl, request: "GET /$
2019/04/13 16:19:19 [error] 20380#20380: *4 open() "/var/www/portfolio/public/images/icons/iphone/iphone-8.png" failed (2: No such file or directory), client: 83.28.244.168, server: jakubdev.pl, request: "GET /$
2019/04/13 16:19:19 [error] 20380#20380: *6 open() "/var/www/portfolio/public/images/icons/iphone/iphone-8-plus.png" failed (2: No such file or directory), client: 83.28.244.168, server: jakubdev.pl, request: "$
2019/04/13 16:19:19 [error] 20380#20380: *3 open() "/var/www/portfolio/public/images/icons/iphone/iphone-6s.png" failed (2: No such file or directory), client: 83.28.244.168, server: jakubdev.pl, request: "GET $
2019/04/13 16:19:19 [error] 20380#20380: *3 open() "/var/www/portfolio/public/javascripts/parallax.min.js" failed (2: No such file or directory), client: 83.28.244.168, server: jakubdev.pl, request: "GET /javas$
2019/04/13 16:26:11 [warn] 20413#20413: duplicate MIME type "text/css" in /etc/nginx/nginx.conf:57
2019/04/13 16:26:11 [warn] 20413#20413: duplicate MIME type "application/json" in /etc/nginx/nginx.conf:57
2019/04/13 16:26:11 [warn] 20413#20413: duplicate MIME type "text/xml" in /etc/nginx/nginx.conf:57
2019/04/13 16:26:11 [warn] 20413#20413: duplicate MIME type "application/xml" in /etc/nginx/nginx.conf:57
2019/04/13 16:26:11 [warn] 20413#20413: duplicate MIME type "application/xml+rss" in /etc/nginx/nginx.conf:57
2019/04/13 16:26:11 [warn] 20413#20413: duplicate MIME type "text/javascript" in /etc/nginx/nginx.conf:57
2019/04/13 16:26:11 [warn] 20424#20424: duplicate MIME type "text/css" in /etc/nginx/nginx.conf:57
2019/04/13 16:26:11 [warn] 20424#20424: duplicate MIME type "application/json" in /etc/nginx/nginx.conf:57
2019/04/13 16:26:11 [warn] 20424#20424: duplicate MIME type "text/xml" in /etc/nginx/nginx.conf:57
2019/04/13 16:26:11 [warn] 20424#20424: duplicate MIME type "application/xml" in /etc/nginx/nginx.conf:57
2019/04/13 16:26:11 [warn] 20424#20424: duplicate MIME type "application/xml+rss" in /etc/nginx/nginx.conf:57
2019/04/13 16:26:11 [warn] 20424#20424: duplicate MIME type "text/javascript" in /etc/nginx/nginx.conf:57