https://github.com/alex-shpak/nginx-proxy
A very simple nginx reverse proxy with automatic letsencrypt certificates
https://github.com/alex-shpak/nginx-proxy
certbot docker letsencrypt nginx reverse-proxy
Last synced: 10 months ago
JSON representation
A very simple nginx reverse proxy with automatic letsencrypt certificates
- Host: GitHub
- URL: https://github.com/alex-shpak/nginx-proxy
- Owner: alex-shpak
- Created: 2017-12-19T12:37:42.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2020-02-25T13:39:58.000Z (over 6 years ago)
- Last Synced: 2025-03-25T09:02:32.756Z (about 1 year ago)
- Topics: certbot, docker, letsencrypt, nginx, reverse-proxy
- Language: Assembly
- Homepage: https://hub.docker.com/r/lxshpk/nginx-proxy/
- Size: 18.6 KB
- Stars: 5
- Watchers: 3
- Forks: 3
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## Nginx proxy in docker
[](https://hub.docker.com/r/lxshpk/nginx-proxy/)
[](https://hub.docker.com/r/lxshpk/nginx-proxy/)
A very simple nginx reverse proxy with automatic letsencrypt certificates.
If you are looking for more featured proxy check [here](https://github.com/jwilder/nginx-proxy)
### Features
- Supports multiple hosts
- Proxying both http and https endpoints
- Minimal configuration with env variables
- Automated issue and renew for [letsencrypt](https://letsencrypt.org) certificates
### Usage
See docker compose example [docker-compose.yml](docker-compose.yml)
```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: mail@example.com
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.