Skip to content

Instantly share code, notes, and snippets.

@enric1994
Created November 21, 2018 14:15
Show Gist options
  • Select an option

  • Save enric1994/fc6d6be75f29d910f8c3a590e2e860e5 to your computer and use it in GitHub Desktop.

Select an option

Save enric1994/fc6d6be75f29d910f8c3a590e2e860e5 to your computer and use it in GitHub Desktop.
Docker Compose file to setup a HTTPS proxy that exposes a web server.
version: '3'
services:
nginx-proxy:
image: jwilder/nginx-proxy
ports:
# Check that the other applications are not using the ports 80 or 443
- "80:80"
# By default this proxy redirects from the port 80 to the 443
- "443:443"
volumes:
- /var/run/docker.sock:/tmp/docker.sock:ro
# Add test.domain.key and test.domain.crt to the certs folder
# Where the first one is the private key and the second one is the certificate
# The filename must match the domain
- ./nginx/certs:/etc/nginx/certs
nginx:
image: nginx
environment:
# To run this example add this to your /etc/hosts file:
# 127.0.0.1 test.domain
- VIRTUAL_HOST=test.domain
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment