现在我已经设置了 Nginx 来提供我确信是有效的文件路径的服务。但是,它给了我一个 404 未找到。
我看过/var/log/nginx/access.log
它向我展示了:
[05/Oct/2016:19:15:50 -0500] "GET /menu.html HTTP/1.1" 404 571 "-" "Mozilla/5.0 ....
但不是它尝试在本地主机上访问的路径,应该是/usr/share/nginx/html/menu.html
。如何配置 Nginx 来显示这些信息?
我建议尝试一下log_format
指令与$realpath_root
(or $document_root
) and $request_filename
属性。
阅读此文档并根据需要自定义您的日志:
http://nginx.org/en/docs/http/ngx_http_log_module.html#log_format http://nginx.org/en/docs/http/ngx_http_log_module.html#log_format
http://nginx.org/en/docs/http/ngx_http_core_module.html#variables http://nginx.org/en/docs/http/ngx_http_core_module.html#variables
https://www.digitalocean.com/community/tutorials/how-to-configure-logging-and-log-rotation-in-nginx-on-an-ubuntu-vps https://www.digitalocean.com/community/tutorials/how-to-configure-logging-and-log-rotation-in-nginx-on-an-ubuntu-vps
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)