dockerfile / nginx

Nginx Dockerfile for trusted automated Docker builds.
http://dockerfile.github.io/#/nginx
MIT License
479 stars 537 forks source link

/etc/nginx/conf.d/, not /etc/nginx/sites-enabled/ #12

Open karabijavad opened 10 years ago

karabijavad commented 10 years ago

currently, the nginx.conf file includes this:

include /etc/nginx/conf.d/*.conf;
adam-beck commented 9 years ago

It also includes:

include /etc/nginx/sites-enabled/*;

You can make sure of this by running docker cp <CONTAINER_ID>:/etc/nginx/nginx.conf ./nginx.conf

or

docker cp <CONTAINER_NAME>:/etc/nginx/nginx.conf ./nginx.conf

Then review the resulting file.

nick-allen commented 9 years ago

Not seeing any reference to sites-enabled in the nginx.conf in the latest image. Only include directives are for mime.types and conf.d/*.conf.

metal3d commented 9 years ago

I agree @nick-allen sites-enabled is not included in configuration.

Note that "site-enabled" is a "debian model" (not a bad ideao BTW) that is not the common method. Centos, RedHat and so on doesn't use that method.

nginx image should change configuration to include site-enabled.

UPDATE: the build process could add "conf.d/sites-enabled.conf" files that include "sites-enabled" too...

metal3d commented 9 years ago

I come back to confirm @nick-allen default.conf that is in conf.d serve "/" location. That disable our configuation even if I link my file in conf.d The better way is to change volume mapping to not use /etc/nginx/sites-enabled but /etc/nginx/conf.d - so only change documentation.

nick-allen commented 9 years ago

Yea, that works perfectly fine.

pilerou commented 9 years ago

I lost 2 hours on it. I just added a pull request #18 to modify documentation.

metal3d commented 9 years ago

:+1: @pilerou

sharpner commented 9 years ago

thanks for this ticket....

atavakoli commented 8 years ago

It looks like #18 was merged. Should this issue be closed now?

christopher-francisco commented 6 years ago

Any chance we can put this in the Docker Hub documentation?

JamesTheHacker commented 5 years ago

So does this mean I have to create an /etc/nginx/nginx.conf (including all the nginx configuration) from scratch instead of just a sites-enabled/my-site.com.conf ? Little confused as I've had this problem today and it's taken me hours to get to this.

metal3d commented 5 years ago

@JamesTheHacker You only need to put your configuration un "/etc/nginx/conf.d" directory inside the container (via volume, or via ADD in Dockerfile). The default /etc/nginx/nginx.conf that is in the container will include them all.