环境:CentOS 6.5 64bit
nginx version: nginx/1.12.2
nginx/1.12.2 源码安装,conf有如下:
[root@localhost conf]# pwd
/usr/local/nginx/conf
[root@localhost conf]# ll
total 60
-rw-r--r-- 1 root root 1077 Jan 12 15:26 fastcgi.conf
-rw-r--r-- 1 root root 1077 Jan 12 15:26 fastcgi.conf.default
-rw-r--r-- 1 root root 1007 Jan 12 15:26 fastcgi_params
-rw-r--r-- 1 root root 1007 Jan 12 15:26 fastcgi_params.default
-rw-r--r-- 1 root root 2837 Jan 12 15:26 koi-utf
-rw-r--r-- 1 root root 2223 Jan 12 15:26 koi-win
-rw-r--r-- 1 root root 3957 Jan 12 15:26 mime.types
-rw-r--r-- 1 root root 3957 Jan 12 15:26 mime.types.default
-rw-r--r-- 1 root root 2656 Jan 12 15:26 nginx.conf
-rw-r--r-- 1 root root 2656 Jan 19 13:40 nginx.conf.default
-rw-r--r-- 1 root root 636 Jan 12 15:26 scgi_params
-rw-r--r-- 1 root root 636 Jan 12 15:26 scgi_params.default
-rw-r--r-- 1 root root 664 Jan 12 15:26 uwsgi_params
-rw-r--r-- 1 root root 664 Jan 12 15:26 uwsgi_params.default
-rw-r--r-- 1 root root 3610 Jan 12 15:26 win-utf
通过如下命令,可以确认默认conf是:nginx.conf
[root@localhost conf]# ../sbin/nginx -t
nginx: the configuration file /usr/local/nginx/conf/nginx.conf syntax is ok
nginx: configuration file /usr/local/nginx/conf/nginx.conf test is successful
diff查看,nginx.conf 和 nginx.conf.default内容一致。
[root@localhost conf]# diff nginx.conf nginx.conf.default
但是系统默认使用的是nginx.conf,所以如果要修改配置,要修改的文件是:nginx.conf