est*_*est 42 linux configuration dump process nginx
是否有可能只从运行的nginx进程中获取nginx使用的conf?
获取conf文件路径.有时会ps aux揭示它,有时它不会.它可能就像nginx: master process /usr/sbin/nginx(相同/proc/PID/cmdline)
nginx -V唯一的解决办法?Gor*_*don 52
从Nginx 1.9.2开始,你可以使用-T标志转储Nginx配置:
-T- 同样-t,但另外将配置文件转储到标准输出(1.9.2).
资料来源:http://nginx.org/en/docs/switches.html
这与特定进程的转储不同.如果您的Nginx正在使用不同的配置文件,请检查输出ps aux并使用它提供的任何内容作为二进制文件,例如,如果它给出类似的东西
nginx: master process /usr/sbin/nginx -c /some/other/config
Run Code Online (Sandbox Code Playgroud)
你需要跑
/usr/sbin/nginx -c /some/other/config -T
Run Code Online (Sandbox Code Playgroud)
如果你还没有使用1.9.2,你可以使用gdb转储配置: