Skip to content

Commit 68834ca

Browse files
committed
Refactor NGINX configuration for /api/v1/mcp to enhance SSE support and improve request handling
1 parent f5540d5 commit 68834ca

1 file changed

Lines changed: 16 additions & 19 deletions

File tree

deploy/ebs-staging-prod.sh

Lines changed: 16 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -458,29 +458,26 @@ server {
458458
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;
459459
460460
location /api/v1/mcp/ {
461+
proxy_pass http://${APP_NAME}_upstream;
462+
proxy_http_version 1.1;
461463
462-
proxy_pass http://app_upstream;
463-
464-
proxy_http_version 1.1;
465-
466-
# REQUIRED FOR SSE
467-
proxy_buffering off;
468-
proxy_cache off;
469-
chunked_transfer_encoding off;
470-
471-
proxy_set_header Connection '';
472-
proxy_set_header Host $host;
464+
# Required for SSE
465+
proxy_buffering off;
466+
proxy_cache off;
467+
chunked_transfer_encoding off;
473468
474-
proxy_set_header X-Forwarded-Proto $scheme;
475-
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
476-
proxy_set_header X-Real-IP $remote_addr;
469+
proxy_set_header Connection '';
470+
proxy_set_header Host $host;
471+
proxy_set_header X-Forwarded-Proto $scheme;
472+
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
473+
proxy_set_header X-Real-IP $remote_addr;
477474
478-
# LONG LIVED STREAM
479-
proxy_read_timeout 86400;
480-
proxy_send_timeout 86400;
475+
# Long-lived stream
476+
proxy_read_timeout 86400;
477+
proxy_send_timeout 86400;
481478
482-
add_header Cache-Control no-cache;
483-
}
479+
add_header Cache-Control no-cache;
480+
}
484481
485482
location / {
486483
proxy_pass http://${APP_NAME}_upstream;

0 commit comments

Comments
 (0)