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
2021服务器价格出炉,又降价了!
拼团:阿里云服务器拼团(全网最低价,直接买不用拉人)
①真便宜:阿里云服务器69元1年,203元3年(全网最低价)
②腾讯云:腾讯云服务器特惠88元一年起(有高配)
③代金券:2021阿里云代金券一键领取中
发表评论