The Nginx configuration is placed in the nginx.confFile, in general we can use the following command to view the nginx.conf files that exist on the server.
Locate Nginx.conf/usr/local/etc/nginx/nginx.conf/usr/local/etc/nginx/nginx.conf.default ...
If there are multiple nginx.conf files in the server, we do not know which configuration file is actually called, so we must find the actual called configuration file in order to modify it.
View the configuration file that Nginx actually calls
1. View Nginx Path
PS Aux|grep nginxroot 352 0.0 0.0 2468624 924 ?? S 10:43 am 0:00.08 nginx:worker process root 232 0.0 0.0 2459408 532 ?? S 10:43 0:00.02 nginx:master process/usr/local/opt/nginx/bin/nginx-g daemon off; Root 2345 0.0 0.0 2432772 640 s000 s+ 1:01 pm 0:00.00 grep nginx
The path of Nginx is:/usr/local/opt/nginx/bin/nginx
2. View Nginx configuration file path
Using the Nginx- T parameter for configuration checking, you can know the actual invocation of the configuration file path and whether the call is valid.
/usr/local/opt/nginx/bin/nginx-tnginx:the configuration file/usr/local/etc/nginx/nginx.conf syntax is Oknginx: Configuration file/usr/local/etc/nginx/nginx.conf test is successful
The test indicates that the Nginx configuration file path is:/usr/local/etc/nginx/nginx.conf and the call is valid.
Nginx configuration is placed in the nginx.conf file, in general we can use the following command to view the nginx.conf files that exist on the server.
Locate Nginx.conf/usr/local/etc/nginx/nginx.conf/usr/local/etc/nginx/nginx.conf.default ...
If there are multiple nginx.conf files in the server, we do not know which configuration file is actually called, so we must find the actual called configuration file in order to modify it.
View the configuration file that Nginx actually calls
1. View Nginx Path
PS Aux|grep nginxroot 352 0.0 0.0 2468624 924 ?? S 10:43 am 0:00.08 nginx:worker process root 232 0.0 0.0 2459408 532 ?? S 10:43 0:00.02 nginx:master process/usr/local/opt/nginx/bin/nginx-g daemon off; Root 2345 0.0 0.0 2432772 640 s000 s+ 1:01 pm 0:00.00 grep nginx
The path of Nginx is:/usr/local/opt/nginx/bin/nginx
2. View Nginx configuration file path
Using the Nginx- T parameter for configuration checking, you can know the actual invocation of the configuration file path and whether the call is valid.
/usr/local/opt/nginx/bin/nginx-tnginx:the configuration file/usr/local/etc/nginx/nginx.conf syntax is Oknginx: Configuration file/usr/local/etc/nginx/nginx.conf test is successful
The test indicates that the Nginx configuration file path is:/usr/local/etc/nginx/nginx.conf and the call is valid.
This article explains the Nginx Quick View configuration file method, more relevant content please pay attention to the PHP Chinese network.
Related recommendations:
A method of combining multiple one-dimensional combinations of PHP into two-dimensional arrays
PHP Returns a method that specifies multiple columns in an array
MySQL secure-file-priv option Problem Solving method