I have Nginx up and running on my server and everything works well. I am trying to migrate over to run Nginx in a Docker container.
I have copied all files in:
- /etc/nginx to /home/raphattack/docker/nginx/etc
- /usr/share/nginx to /home/raphattack/docker/nginx/share
I am using the following command to run the Docker image:
sudo docker run --detach \
--name nginx \
--publish 80:80 \
--publish 443:443 \
--volume /home/raphattack/docker/nginx/etc:/etc/nginx \
--volume /home/raphattack/docker/nginx/share:/usr/share/nginx \
nginx
This fails with the error:
2019/10/08 21:18:58 [emerg] 1#1: open() "/etc/nginx/modules-enabled/50-mod-http-geoip.conf" failed (2: No such file or directory) in /etc/nginx/nginx.conf:4
nginx: [emerg] open() "/etc/nginx/modules-enabled/50-mod-http-geoip.conf" failed (2: No such file or directory) in /etc/nginx/nginx.conf:4
Line 4 in my nginx.conf:
include /etc/nginx/modules-enabled/*.conf;
The file in question is a symlink:
/etc/nginx/modules-enabled/50-mod-http-geoip.conf -> /usr/share/nginx/modules-available/mod-http-geoip.conf