I've created a simple Docker container with Nginx inside and for some reason, it won't access the www
volume data from the host.
Here is the command I used:
docker run \
-d \
-p 8080:80 \
--name nginx \
--restart always \
-v /etc/nginx/nginx.conf:/etc/nginx/nginx.conf:ro \
-v /var/www:/usr/share/nginx/html \
-v /home/myuser/myvhost.conf:/etc/nginx/sites-enabled/myvhost.conf:ro \
-v /var/log/nginx:/var/log/nginx \
nginx:1.9.4;
All the volumes are correctly mounted (I checked with docker inspect
) but when go on the website I get a 404 and the Nginx error.log
on the host says:
"/var/www/docker/index.html" is not found (2: No such file or directory)
It's surprising because this path is definitely correct...