Self-hosted US Congress monitoring platform with AI policy briefs, bill/member/topic follows, ntfy + RSS + email notifications, alignment scoring, collections, and draft-letter generator. Authored by: Jack Levy
55 lines
1.7 KiB
Nginx Configuration File
55 lines
1.7 KiB
Nginx Configuration File
events {
|
|
worker_connections 1024;
|
|
}
|
|
|
|
http {
|
|
include /etc/nginx/mime.types;
|
|
default_type application/octet-stream;
|
|
sendfile on;
|
|
keepalive_timeout 65;
|
|
|
|
# Use Docker's internal DNS; valid=10s forces re-resolution after container restarts.
|
|
# Variables in proxy_pass activate this resolver (upstream blocks do not).
|
|
resolver 127.0.0.11 valid=10s ipv6=off;
|
|
|
|
server {
|
|
listen 80;
|
|
server_name _;
|
|
|
|
client_max_body_size 10M;
|
|
|
|
# API — variable forces re-resolution via resolver on each request cycle
|
|
location /api/ {
|
|
set $api http://api:8000;
|
|
proxy_pass $api;
|
|
proxy_set_header Host $host;
|
|
proxy_set_header X-Real-IP $remote_addr;
|
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
proxy_set_header X-Forwarded-Proto $scheme;
|
|
proxy_read_timeout 120s;
|
|
proxy_connect_timeout 10s;
|
|
}
|
|
|
|
# Next.js static assets (long cache)
|
|
location /_next/static/ {
|
|
set $frontend http://frontend:3000;
|
|
proxy_pass $frontend;
|
|
proxy_cache_valid 200 1d;
|
|
add_header Cache-Control "public, max-age=86400, immutable";
|
|
}
|
|
|
|
# Everything else → frontend
|
|
location / {
|
|
set $frontend http://frontend:3000;
|
|
proxy_pass $frontend;
|
|
proxy_set_header Host $host;
|
|
proxy_set_header X-Real-IP $remote_addr;
|
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
# WebSocket support (Next.js HMR in dev)
|
|
proxy_http_version 1.1;
|
|
proxy_set_header Upgrade $http_upgrade;
|
|
proxy_set_header Connection "upgrade";
|
|
}
|
|
}
|
|
}
|