Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Suggestion] initialization script create the "/usr/local/nginx/html" directory #998

Open
dominicx opened this issue Jul 22, 2024 · 3 comments
Labels
in progress question questions about software

Comments

@dominicx
Copy link

What would you like to be added or improved?

当我们在nginx.conf启用日志按日期写入的时候,就会报错“[error] 101#0: *101 testing "/usr/local/nginx/html" existence failed (2: No such file or directory) while logging request,”。
原因是ngx_http_log_module模块会检查root配置目录是否存在。
具体参考:ngx_http_log_module
“during each log write the existence of the request’s root directory is checked, and if it does not exist the log is not created. It is thus a good idea to specify both root and access_log on the same configuration level:”
所以建议在镜像脚本中建立/usr/local/nginx/html目录

Why is it needed?

No response

@xbingW
Copy link
Collaborator

xbingW commented Aug 1, 2024

为啥需要往这个 /usr/local/nginx/html 写

@dominicx
Copy link
Author

为啥需要往这个 /usr/local/nginx/html 写

不是要往这个目录写东西。是如果开启记录访问日志,如果日志路径需要按日期分割的时候 nginx检查了这个目录存不存在。

during each log write the existence of the request’s is checked, and if it does not exist the log is not created.

因为没有设置root,默认root目录是/usr/local/nginx/html。

@Lvshujun0918
Copy link
Contributor

2024/08/20 13:11:28 [error] 158#0: *74504 testing "/usr/local/nginx/html" existence failed (2: No such file or directory) while logging request, client: 112.10.238.214, server: ai.cszj.wang, request: "GET /_next/static/chunks/55244-ef36656f36a5b038.js HTTP/2.0", upstream: "http://127.0.0.1:40247/_next/static/chunks/55244-ef36656f36a5b038.js", host: "ai.cszj.wang", referrer: "https://ai.cszj.wang/sw.js"
同样的问题

@xbingW xbingW added bug Something isn't working question questions about software in progress and removed bug Something isn't working labels Aug 21, 2024
@xbingW xbingW changed the title [Suggestion] 建议safeline-tengine初始化脚本建立"/usr/local/nginx/html"目录 [Suggestion] initialization script create the "/usr/local/nginx/html" directory Sep 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in progress question questions about software
Projects
None yet
Development

No branches or pull requests

3 participants