Skip to content

HTTP/HTTPS gateway for docker containers

Notifications You must be signed in to change notification settings

cauethenorio/nginx-gateway

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Nginx Gateway

nginx-gateway is a ready-to-use docker-compose project which relies on nginx-proxy to act an HTTP/HTTPs gateway for you server, routing the requests to specific docker containers based on the domain.

It also generate/renew your Let's Encrypt certificates using docker-letsencrypt-nginx-proxy-companion.

Read the full documention on: https://github.com/nginx-proxy/nginx-proxy

Usage example:

Adds to your app docker-compose.yaml:

version: "3"

services:
  my-app:
    image: awesome-app-image
    environment:
      VIRTUAL_HOST: example.com
      VIRTUAL_HOST_ALIAS: alternative.example.com,www.example.com
      LETSENCRYPT_HOST: example.com,alternative.example.com,www.example.com
      LETSENCRYPT_EMAIL: email#example.com

networks:
  default:
    external:
      name: nginx-gateway

Virtual Host Aliases

Based on nginx-proxy/nginx-proxy#1369 this project supports creating domain alias which redirect users to the main domain.

You can add aliases that will redirect (301) to the first entry in VIRTUAL_HOST by adding the VIRTUAL_HOST_ALIAS env var: $ docker run -e VIRTUAL_HOST=example.com -e VIRTUAL_HOST_ALIAS=www.example.com,old.example.com ... This will setup the following redirects:

  • http://www.example.comhttp://example.com
  • http://old.example.comhttp://example.com

Remeber to add all the aliases to the LETSENCRYPT_HOST to generate their certificates.

About

HTTP/HTTPS gateway for docker containers

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published