Skip to content

🐳 5 steps to set up reverse proxy and HTTPS (SSL certificate) for Docker container

Notifications You must be signed in to change notification settings

blackbass64/docker-https

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 

Repository files navigation

🐳 5 steps to set up reverse proxy and HTTPS (SSL certificate) for Docker container

  1. Create Docker compose file for nginx-proxy stacks same as nginx-proxy.yaml

  2. Run nginx-proxy stacks

$ docker-compose -f nginx-proxy.yaml up -d
  1. Add these environment variables to your container, for example whoami.yaml
  • VIRTUAL_HOST - Domain to access the container
  • VIRTUAL_PORT - Container port
  • LETSENCRYPT_HOST - Domain for issuing SSL certificate by Let's Encrypt
  • LETSENCRYPT_EMAIL - Your email for Let's Encrypt notifications
  1. Start/Restart the container
# example
$ docker-compose -f whoami.yaml up -d
  1. Test

Run the following command to test the reverse proxy locally

$ curl -L -H "Host: <YOUR_DOMAIN>" localhost

Then go to your domain on browser for HTTPS and SSL certificate verification


Thanks nginx-proxy for the awesome tool

About

🐳 5 steps to set up reverse proxy and HTTPS (SSL certificate) for Docker container

Topics

Resources

Stars

Watchers

Forks