Open karabijavad opened 10 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.
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
.
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...
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.
Yea, that works perfectly fine.
I lost 2 hours on it. I just added a pull request #18 to modify documentation.
:+1: @pilerou
thanks for this ticket....
It looks like #18 was merged. Should this issue be closed now?
Any chance we can put this in the Docker Hub documentation?
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.
@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.
currently, the nginx.conf file includes this: