How to quickly view configuration files with Nginx

Source: Internet
Author: User
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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.