-
Notifications
You must be signed in to change notification settings - Fork 97
Howto: Use The Web Service Behind nginx proxy
Jeffrey Boehm edited this page Sep 5, 2019
·
1 revision
nginx-proxy sets up a container running nginx and docker-gen. docker-gen generates reverse proxy configs for nginx and reloads nginx when containers are started and stopped.
- Uncomment the environment variable VIRTUAL_HOST from
docker-compose.yml
:web: image: jeboehm/mailserver-web:latest ... environment: - VIRTUAL_HOST=mail.example.com
- Change the variable to the (sub-) domain you want to use.
- Remove the
web
service port definition fromdocker-compose.production.yml
:web: ports: - "0.0.0.0:81:80"
Be aware that nginx-proxy needs to be connected to your mail network, since docker-compose creates a new one
for each project. You can do so by executing for example docker network connect mail_default nginx-proxy
.
More information:
https://github.com/jwilder/nginx-proxy
http://jasonwilder.com/blog/2014/03/25/automated-nginx-reverse-proxy-for-docker/