Skip to content

Instantly share code, notes, and snippets.

@mattfysh
Last active January 31, 2022 04:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mattfysh/22cb52aad3920dc02f0bf1a5773209eb to your computer and use it in GitHub Desktop.
Save mattfysh/22cb52aad3920dc02f0bf1a5773209eb to your computer and use it in GitHub Desktop.
version: "3.9"
services:
proxy:
depends_on:
- certs
image: nginx
ports:
- "80:80"
- "443:443"
volumes:
- "./nginx.conf:/etc/nginx/nginx.conf:ro"
- "certs:/etc/nginx/certs:ro"
networks:
platform:
ipv4_address: 10.5.0.2
certs:
environment:
- CA_CERT=/certs/self-signed.crt
- CA_KEY=/certs/self-signed.key
- CA_EXPIRE=3650
- SSL_SIZE=2048
image: paulczar/omgwtfssl
volumes:
- certs:/certs
dns:
image: 4km3/dnsmasq:2.85-r2
ports:
- "53:53/tcp"
- "53:53/udp"
cap_add:
- NET_ADMIN
command: --address="/#/10.5.0.2"
networks:
platform:
ipv4_address: 10.5.0.3
worker:
dns:
- 10.5.0.3
image: ubuntu
command: tail -F anything
networks:
platform:
ipv4_address: 10.5.0.4
networks:
platform:
ipam:
config:
- subnet: 10.5.0.0/16
gateway: 10.5.0.1
volumes:
certs:
events {
worker_connections 1024;
}
http {
server {
listen 80;
location / {
resolver 8.8.8.8;
proxy_pass $scheme://$http_host$uri$is_args$args;
}
}
server {
listen 443 ssl http2;
ssl_certificate /etc/nginx/certs/self-signed.crt;
ssl_certificate_key /etc/nginx/certs/self-signed.key;
location / {
resolver 8.8.8.8;
proxy_pass $scheme://$http_host$uri$is_args$args;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment