Get conf location of a running nginx process

est electronixtar at
Fri Oct 12 01:08:28 UTC 2012

Hi list,

Is there a general way to extract the nginx config file path, in a third
party program?

I see the sudo strace -s reload has this line

open("/etc/nginx/nginx.conf", O_RDONLY|O_LARGEFILE) = 4

but how can I get the string /etc/nginx/nginx.conf ?

I presume I have three ways:

1. ps aux perhaps there is a command line like nginx -c /etc/my.conf
2. nginx -V will list the default conf path
3. If #1 and #2 fails, could it be done reading nginx's process image in

Are there any other scenarios? How do I achieve the #3 way?

Thanks in advance!

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the nginx mailing list