[英]Changing Nginx Log File Location
I can't get any changes in the /etc/nginx/nginx.conf http block to be used. 我无法在/etc/nginx/nginx.conf http块中使用任何更改。 I'm starting with the simplest thing - I want to modify the name of access.log to something else (ie a.log).
我从最简单的事情开始-我想将access.log的名称修改为其他名称(即a.log)。 It is a vanilla nginx install (no custom config files yet).
这是普通的nginx安装(尚无自定义配置文件)。 Here's what I know:
这是我所知道的:
Here is a snippet of my nginx.conf file: 这是我的nginx.conf文件的一个片段:
user www-data;
worker_processes 4;
pid /run/nginx.pid;
events {
worker_connections 768;
}
http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
access_log /var/log/nginx/a.log;
#....
}
Is it something as simple as I'm modifying an http block that gets overwritten by some other config file? 它就像修改一个被其他配置文件覆盖的http块一样简单吗? Thanks for the help.
谢谢您的帮助。
Isn't your access_log also defined in a server block ? 您的access_log是否也在服务器块中定义? Have a look at the default config in nginx/sites-enabled/.
看看nginx / sites-enabled /中的默认配置。 In this case the value in http block is overwritten by the one in the lower block.
在这种情况下,http块中的值将被较低的块中的值覆盖。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.