worker_processes 1; events { worker_connections 1024; } http { include mime.types; default_type application/octet-stream; sendfile on; server { listen 80; location /api/ { proxy_pass http://new-backend:8080/api/; proxy_set_header Host $host; proxy_set_header X-Demo-User $http_x_demo_user; } # Legacy.Web's own routes are "/legacy" and "/legacy/aanvraag/{id}/...", # so the prefix is forwarded as-is (no trailing slash on proxy_pass, # and no trailing slash on the location so a bare "/legacy" matches too). location /legacy { proxy_pass http://legacy-frontend:8080; proxy_set_header Host $host; } location / { proxy_pass http://new-frontend:80/; proxy_set_header Host $host; } } }