Get conf location of a running nginx process

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
    memory?

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

Thanks in advance!

est