项目作者: alex-shpak

项目描述 :
A very simple nginx reverse proxy with automatic letsencrypt certificates
高级语言: Assembly
项目地址: git://github.com/alex-shpak/nginx-proxy.git
创建时间: 2017-12-19T12:37:42Z
项目社区:https://github.com/alex-shpak/nginx-proxy

开源协议:

下载


Nginx proxy in docker

Docker Build Status
Docker Build Status

A very simple nginx reverse proxy with automatic letsencrypt certificates.
If you are looking for more featured proxy check here

Features

  • Supports multiple hosts
  • Proxying both http and https endpoints
  • Minimal configuration with env variables
  • Automated issue and renew for letsencrypt certificates

Usage

See docker compose example docker-compose.yml

  1. version: '3'
  2. services:
  3. nginx:
  4. image: lxshpk/nginx-proxy
  5. restart: unless-stopped
  6. ports:
  7. - "80:80"
  8. - "443:443"
  9. links:
  10. - service
  11. environment:
  12. NGINX_PROXY_PASS: |
  13. https://example.com -> http://service:8080
  14. https://sub.example.com -> http://service:8081
  15. http://external.example.com -> http://external.com
  16. NGINX_CUSTOM_CONFIG: |
  17. # you can write your custom config here
  18. # server_tokens off;
  19. CERTBOT_EMAIL: mail@example.com
  20. CERTBOT_ARGS: --dry-run
  21. # volumes:
  22. # - "/var/lib/letsencrypt:/var/lib/letsencrypt"
  23. # - "/etc/letsencrypt:/etc/letsencrypt"
  24. # - "./custom.conf:/etc/nginx/conf.d/custom.conf
  25. service:
  26. image: ...
  27. ports:
  28. - "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.