nginx.conf的位置一般很好找,但是遇到陌生的Nginx服务器可能路径就不对了,分享大家一个十分精准的寻找nginx.conf配置的方法。
寻找nginx.conf配置文件的方法
一:先找出nginx可执行文件的路径
ps -ef | grep nginx
实例:
1 2 3 4 |
[root@aliyunbaike ~]# ps -ef | grep nginx root 1995 1 0 09:17 ? 00:00:00 nginx: master process /usr/local/nginx/sbin/nginx www 4767 1995 0 09:18 ? 00:00:00 nginx: worker process root 6234 2044 0 09:22 pts/1 00:00:00 grep nginx |
找出配置文件路径
/usr/local/nginx/sbin/nginx -t
实例:
1 2 3 |
[root@aliyunbaike ~]# /usr/local/nginx/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 |
如实例所示,nginx.conf配置文件路径就出来了!nginx: configuration file /usr/local/nginx/conf/nginx.conf test is successful
2023云服务器价格出炉,又降价了!
阿里云:阿里云2核4G服务器6M带宽68元一年起(价格便宜多配置可选)
腾讯云:腾讯云2核4G8M服务器70元一年(查看更多配置报价)
华为云:2023华为云优惠活动云服务器39元一年起(查看更多配置报价)
发表评论