nginx 快速查看配置文件的方法


查看nginx實際調用的配置文件

1.查看nginx路徑

ps aux|grep nginx
root 352 0.0 0.0 2468624 924 ?? S 10:43上午 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下午 0:00.00 grep nginx


nginx的路徑為:/usr/local/opt/nginx/bin/nginx


2.查看nginx配置文件路徑


使用nginx的 -t 參數進行配置檢查,即可知道實際調用的配置文件路徑及是否調用有效。

/usr/local/opt/nginx/bin/nginx -t
nginx: the configuration file /usr/local/etc/nginx/nginx.conf syntax is ok
nginx: configuration file /usr/local/etc/nginx/nginx.conf test is successful


測試可知,nginx的配置文件路徑為:/usr/local/etc/nginx/nginx.conf 且調用有效。


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM