diff --git a/Dockerfile.frontend b/Dockerfile.frontend index 5baba86..9038b18 100644 --- a/Dockerfile.frontend +++ b/Dockerfile.frontend @@ -106,38 +106,15 @@ server { access_log off; } - # Metrics endpoint - location /metrics { - proxy_pass http://backend/metrics; - proxy_http_version 1.1; - proxy_set_header Connection ""; - } - - # Package download endpoints - location ~ ^/(npm|pypi|go)/ { - proxy_pass http://backend; - proxy_http_version 1.1; - 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_set_header Connection ""; - - # Extended timeouts for package downloads - proxy_connect_timeout 60s; - proxy_send_timeout 600s; - proxy_read_timeout 600s; - - # Large buffer for package downloads - proxy_buffering on; - proxy_buffer_size 128k; - proxy_buffers 4 256k; - proxy_busy_buffers_size 256k; + # The package endpoints are not part of the dashboard and stay on the + # backend Service. A catch-all 404 keeps them off the SPA fallback below. + location ~ ^/(npm|pypi|go|metrics)(/|$) { + return 404; } # WebSocket support - location /ws/ { - proxy_pass http://backend/ws/; + location /ws { + proxy_pass http://backend; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade";