现在我已经设置了 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 ....
Run Code Online (Sandbox Code Playgroud)
但不是它尝试在 localhost 上访问的路径,应该是/usr/share/nginx/html/menu.html. 如何配置 Nginx 来显示这些信息?
我建议尝试使用(or ) 和 属性的log_format指令。
阅读此文档并根据需要自定义您的日志:$realpath_root$document_root$request_filename
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
| 归档时间: |
|
| 查看次数: |
3023 次 |
| 最近记录: |