File: //bigscoots/lxd/containers.conf
# /etc/nginx/conf.d/containers.conf
# Map hostnames to container IPs
map $host $target {
default 127.0.0.1; # fallback (could 404)
# --- generated mappings ---
container-01.bigscoots-app.com 10.20.5.11;
container-02.bigscoots-app.com 10.20.5.12;
container-03.bigscoots-app.com 10.20.5.13;
container-04.bigscoots-app.com 10.20.5.14;
container-05.bigscoots-app.com 10.20.5.15;
container-06.bigscoots-app.com 10.20.5.16;
container-07.bigscoots-app.com 10.20.5.17;
container-08.bigscoots-app.com 10.20.5.18;
container-09.bigscoots-app.com 10.20.5.19;
container-10.bigscoots-app.com 10.20.5.20;
container-11.bigscoots-app.com 10.20.5.21;
container-12.bigscoots-app.com 10.20.5.22;
container-13.bigscoots-app.com 10.20.5.23;
container-14.bigscoots-app.com 10.20.5.24;
container-15.bigscoots-app.com 10.20.5.25;
container-16.bigscoots-app.com 10.20.5.26;
container-17.bigscoots-app.com 10.20.5.27;
container-18.bigscoots-app.com 10.20.5.28;
container-19.bigscoots-app.com 10.20.5.29;
container-20.bigscoots-app.com 10.20.5.30;
}
# HTTP listener (can keep it HTTP-only for now; add TLS later)
server {
listen 80 reuseport;
listen [::]:80 reuseport;
# Optional: respond to bare domain with 404 instead of default container
# server_name bigscoots-app.com;
# Proxy to the chosen container by Host header
location / {
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_read_timeout 60s;
proxy_connect_timeout 5s;
proxy_pass http://$target;
}
}