背景
想把服务器上nginx配置文件下载到本地使用vscode打开看的时候,发现进程参数中未指定配置文件目录。
于是查看nginx官网,nginx默认配置文件目录为 /usr/local/nginx/conf, /etc/nginx, or /usr/local/etc/nginx.
然后去上述目录都看一下还是没找到。
解决方案
- nginx -t可以查看配置文件实际使用的目录
nginx: the configuration file /xxxx/nginx.conf syntax is ok
nginx: configuration file /xxxxx/nginx.conf test is successful
- nginx -V:当进程未指定配置文件目录,而且nginx默认搜索的配置目录也不存在时,那应该是在编译的时候就指定了配置文件目录。可以通过nginx -V来确认。nginx -V能够打印出,编译nginx时,configure命令指定了那些参数。
nginx version: nginx/1.18.0
built by gcc 4.8.5 20150623 (Red Hat 4.8.5-39) (GCC)
built with OpenSSL 1.0.2k-fips 26 Jan 2017
TLS SNI support enabled
configure arguments: --prefix=xxx --conf-path=xxxx --user= --group=xxxxx --pid-path=xxxxx/nginx/nginx.pid --error-log-path=xxxx/error.log --http-log-path=xxxxxx/access.log --sbin-path=xxxxxx/nginx
......
219




被折叠的 条评论
为什么被折叠?



