Sign inSign up

lxshpk/nginx-proxy

By lxshpk

•Updated over 6 years ago

A very simple nginx proxy with auto letsencrypt certificates in docker

Image
0

1.2K

lxshpk/nginx-proxy repository overview

⁠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⁠

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.

Tag summary

Content type

Image

Digest

Size

29.6 MB

Last updated

over 6 years ago

docker pull lxshpk/nginx-proxy