Based on official docker nginx image. Please read full documentation before running this image.
Default image was extended to implement automation in ssl certificate creation by using letsencrypt/certbot.
1.13.3, 1.13, 1, latest (run make build-latest) (Dockerfile)1.13.3-alpine, 1.13-alpine, 1-alpine, alpine (run make build-alpine) (Dockerfile)Alpine is still not fixed. Use Debian based.
docker run --name some-nginx -v /some/content:/usr/share/nginx/html:ro -d qubestash/nginx
docker run --name some-nginx -v /some/nginx.conf:/etc/nginx/nginx.conf:ro -d qubestash/nginx
Default value:
--agree-tos
Will allow adding certbot options when generating new cerficates. This option can be used, for example, for staging environments.
Default value:
[email protected]
Will allow setting a default email address to assign to all certificates generated using letsencrypt.
docker run --name some-nginx \
-v /some/letsencrypt:/etc/letsencrypt \
-v /some/nginx/conf.d:/etc/nginx/conf.d \
-v /some/nginx/ssl:/etc/nginx/ssl \
-v /some/qubestash:/var/qubestash \
-d qubestash/nginx
Folder to mount for reaching letsencrypt's ssl certificates.
Folder to mount for reaching nginx's configuration files/folders. You could either mount each config file/folder separately or mount the entire folder as a block.
This is a common folder used to store various information and share them between different QubeStash projects.
In this case, it will store hashes generate for the letsencrypt generated certificates, so that certbot won't generate the certificates at every container restart.
When using certbot (letsencrypt) for generating SSL Certificates ...
server {
listen 80;
server_name local.foo subdomain.local.foo;
return 301 https://$host$request_uri;
}
server {
listen 443 ssl;
server_name local.foo subdomain.local.foo;
ssl_certificate /etc/letsencrypt;
ssl_certificate_key /etc/letsencrypt;
location / {
root /usr/share/nginx/html;
index index.html index.htm;
}
location = /50x.html {
root /usr/share/nginx/html;
}
}
Before attempting to run Nginx with Certbot certificate generation, please remember to read Letsencrypt's Rate Limits and Staging Environment articles.
Please note it is forbidden to create nginx host configs using multiple domain names in the same file. If, for example, you will need to mount a website/applicaiton on two different domains, when using certbot, you will need to create a config file for each domain.
The rule above does not apply for several subdomains of the same domain.
i.e.
# for local1.foo
server {
listen 80;
server_name local1.foo subdomain.local1.foo;
return 301 https://$host$request_uri;
#...
}
server {
listen 443 ssl;
server_name local1.foo subdomain.local1.foo;
ssl_certificate /etc/letsencrypt;
ssl_certificate_key /etc/letsencrypt;
# ...
}
# for local2.foo
server {
listen 80;
server_name local2.foo subdomain.local2.foo;
return 301 https://$host$request_uri;
#...
}
server {
listen 443 ssl;
server_name local2.foo subdomain.local2.foo;
ssl_certificate /etc/letsencrypt;
ssl_certificate_key /etc/letsencrypt;
# ...
}
both domain poiting to the same website/application.
When usign 3rd party SSL Certificates, place all certificates in a specific folder and mount it to /etc/nginx/ssl
docker folder.
docker run --name some-nginx -v /some/nginx/ssl-certs:/etc/nginx/ssl:ro -d qubestash/nginx
Than reffer all configs that use those certificates to that folder:
# ...
server {
listen 443 ssl;
server_name local.foo subdomain.local.foo;
ssl_certificate /etc/nginx/ssl/local.fullchain.pem;
ssl_certificate_key /etc/nginx/ssl/local.privkey.pem;
# ...
}
Content type
Image
Digest
Size
55.7 MB
Last updated
about 9 years ago
docker pull qubestash/nginx