Skip to content

Instantly share code, notes, and snippets.

@l0gicgate
Created June 14, 2019 04:02
Show Gist options
  • Save l0gicgate/b53fd573eb9c8f7c8a0f445178bcf70e to your computer and use it in GitHub Desktop.
Save l0gicgate/b53fd573eb9c8f7c8a0f445178bcf70e to your computer and use it in GitHub Desktop.
version: "3.7"
networks:
load-balancer-network:
external: true
client-network:
name: client-network
services:
client-webserver:
container_name: client-webserver
image: nginx:alpine
networks:
- load-balancer-network
ports:
- 8080:80
volumes:
- ./:/client
- ./docker/nginx/default.conf:/etc/nginx/conf.d/default.conf
server {
listen 80;
server_name redacted.host;
return 301 https://redacted.host$request_uri;
}
server {
listen 443 ssl http2;
client_max_body_size 10G;
server_name redacted.host;
ssl_certificate /etc/letsencrypt/live/redacted.host/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/redacted.host/privkey.pem;
location / {
proxy_pass http://client-webserver:8080;
proxy_redirect off;
proxy_set_header Host redacted.host;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_buffering off;
}
}
version: "3.7"
networks:
load-balancer-network:
name: load-balancer-network
services:
load-balancer-webserver:
container_name: load-balancer-webserver
image: nginx:alpine
networks:
- load-balancer-network
ports:
- 0.0.0.0:80:80
- 0.0.0.0:443:443
volumes:
- ./docker/letsencrypt/live:/etc/letsencrypt/live
- ./docker/nginx:/etc/nginx/conf.d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment