A very simple nginx proxy with auto letsencrypt certificates in docker
1.2K
A very simple nginx reverse proxy with automatic letsencrypt certificates.
If you are looking for more featured proxy check here
See docker compose example docker-compose.yml
version: '3'
services:
nginx:
image: lxshpk/nginx-proxy
restart: unless-stopped
ports:
- "80:80"
- "443:443"
links:
- service
environment:
NGINX_PROXY_PASS: |
https://example.com -> http://service:8080
https://sub.example.com -> http://service:8081
http://external.example.com -> http://external.com
NGINX_CUSTOM_CONFIG: |
# you can write your custom config here
# server_tokens off;
CERTBOT_EMAIL: [email protected]
CERTBOT_ARGS: --dry-run
# volumes:
# - "/var/lib/letsencrypt:/var/lib/letsencrypt"
# - "/etc/letsencrypt:/etc/letsencrypt"
# - "./custom.conf:/etc/nginx/conf.d/custom.conf
service:
image: ...
ports:
- "8080:8080"
When started docker container will request SSL certificates for example.com and sub.example.com or will fail to start if not successful. Domain external.example.com will be hosted with http.
Content type
Image
Digest
Size
29.6 MB
Last updated
over 6 years ago
docker pull lxshpk/nginx-proxy