# Get conf location of a running nginx process

**URL:** <https://www.ruby-forum.com/t/get-conf-location-of-a-running-nginx-process/223636>\
**Category:** NGINX\
**Created:** [October 12, 2012, 3:09am UTC](https://www.ruby-forum.com/t/get-conf-location-of-a-running-nginx-process/223636 "2012-10-12T03:09:12Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![aris](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/258eb7/32.png) [@aris](https://www.ruby-forum.com/u/aris)\
**Post date:** [October 12, 2012, 3:09am UTC](https://www.ruby-forum.com/t/get-conf-location-of-a-running-nginx-process/223636/1 "2012-10-12T03:09:12Z")

</div>

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
