# Include files relative to nginx.conf

**URL:** <https://www.ruby-forum.com/t/include-files-relative-to-nginx-conf/153406>\
**Category:** NGINX\
**Created:** [November 16, 2008, 5:29pm UTC](https://www.ruby-forum.com/t/include-files-relative-to-nginx-conf/153406 "2008-11-16T17:29:58Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Joaquin\_Cuenca\_Abel](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/3da27b/32.png) [@Joaquin\_Cuenca\_Abel](https://www.ruby-forum.com/u/Joaquin_Cuenca_Abel)\
**Post date:** [November 16, 2008, 5:29pm UTC](https://www.ruby-forum.com/t/include-files-relative-to-nginx-conf/153406/1 "2008-11-16T17:29:58Z")

</div>

Hi,

the docs say that “Since version 0.6.7, paths are relative to  
directory of nginx configuration file nginx.conf, but not to nginx  
prefix directory.”

I have nginx.conf 0.7.21 in directory C:\foo\etc\windows\nginx.conf  
and I run nginx with:

nginx -c C:\foo\etc\windows\nginx.conf

In nginx.conf I have an include as in:

location / {  
include fastcgi.conf;  
}

I was expecting nginx to open the fastcgi.conf file in  
C:\foo\etc\windows\fastcgi.conf, but instead it opens the fastcgi.conf  
in C:\nginx\conf\fastcgi.conf  
I guess it’s not a linux / win difference, but I can try in linux if  
you want to double check.

Am I misunderstanding the docs expecting include to include files  
relative to the directory where nginx.conf is located? any  
work-arounds to have the entire configuration in different directories  
having relative paths in the includes?

Thanks!
