-
Create Docker compose file for nginx-proxy stacks same as nginx-proxy.yaml
-
Run nginx-proxy stacks
$ docker-compose -f nginx-proxy.yaml up -d
- 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
- Start/Restart the container
# example
$ docker-compose -f whoami.yaml up -d
- 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