请问nginx的配置文件nginx.conf在哪里?

您所在的位置:网站首页 nginx配置文件夹 请问nginx的配置文件nginx.conf在哪里?

请问nginx的配置文件nginx.conf在哪里?

2023-03-15 02:48| 来源: 网络整理| 查看: 265

root@iZuf6flak68jcii4kf10hpZ:~# ps -ef | grep nginxroot 8329 1 0 Mar07 ? 00:00:00 nginx: master process /usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.confnobody 8330 8329 0 Mar07 ? 00:00:00 nginx: worker processroot 12684 12668 0 15:55 pts/1 00:00:00 grep --color=auto nginx

说明 当前使用的 nginx 进程是 /usr/local/nginx/sbin/nginx 这样启动的。使用的配置文件就是 /usr/local/nginx/conf/nginx.conf nginx 这个命令是可以指定配置文件的。

因为你的系统还有一个默认的 nginx ,所以你执行 nginx -t 会看到这样的结果root@iZuf6flak68jcii4kf10hpZ:~# nginx -tnginx: the configuration file /etc/nginx/nginx.conf syntax is oknginx: configuration file /etc/nginx/nginx.conf test is successful

所以你不能这样执行,应该执行 /usr/local/nginx/sbin/nginx -t为了 能直接使用 nginx -t 你应该把你安装的 nginx 加到 PATH 里面



【本文地址】


今日新闻


推荐新闻


CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3