Nginx Docker image - based on Debian Wheezy
This is the janeczku/debian-nginx Docker image providing Nginx 1.8 (Dotdeb) with a well organized configuration layout tuned for great performance.
/data/www # web content
/data/conf/nginx/ # extra Nginx configs
Default host will be generated by setting env var GENERATE_DEFAULT_HOST=true
. It will serve the content located in /data/www/default
.
The default host is configured to work on HTTPS as well.
Nginx error logs are available via docker logs [container]
.
docker run -d --name=web -p=80:80 -p=443:443 -e GENERATE_DEFAULT_HOST=true janeczku/debian-nginx
FROM janeczku/debian-nginx
ADD webroot /data/www/default/
ADD default-host.conf /data/conf/nginx/hosts.d/
docker run -d --name=web-data -v /data busybox
docker run -d --name=web --volumes-from=web-data -p=80:80 -e GENERATE_DEFAULT_HOST=true janeczku/debian-nginx
Modify Nginx global configuration (http {} context) by adding configs in any of the following locations:
/etc/nginx/nginx.d/*.conf
/data/conf/nginx/nginx.d/*.conf
/etc/nginx/addon.d/*.conf
/data/conf/nginx/addon.d/*.conf
Add hosts by placing their configs in following locations:
/etc/nginx/hosts.d/*.conf
/data/conf/nginx/hosts.d/*.conf
Extra location for including configs in host.conf, in server {} context:
include /etc/nginx/conf.d/default-*.conf;
include /data/conf/nginx/conf.d/default-*.conf;