From 9e24a3583ef9a5aa5e20d7f7d7bccbbf9c004cc4 Mon Sep 17 00:00:00 2001 From: rjshrjndrn Date: Mon, 2 Jun 2025 10:52:21 +0200 Subject: [PATCH] feat(nginx): add integrations endpoint with CORS support Add new /integrations/ location block that proxies requests to integrations-openreplay:8080 service. Includes proper CORS headers for cross-origin requests and WebSocket upgrade support. - Rewrite /integrations/ path to root - Configure proxy headers for forwarding - Set connection timeouts for stability - Add CORS headers for API access Signed-off-by: rjshrjndrn --- scripts/docker-compose/nginx.conf | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/scripts/docker-compose/nginx.conf b/scripts/docker-compose/nginx.conf index 198644bb4..9fa68e477 100644 --- a/scripts/docker-compose/nginx.conf +++ b/scripts/docker-compose/nginx.conf @@ -54,6 +54,25 @@ server { add_header 'Access-Control-Allow-Headers' 'Content-Type,Authorization,Content-Encoding'; add_header 'Access-Control-Expose-Headers' 'Content-Length'; } + location /integrations/ { + rewrite ^/integrations/(.*) /$1 break; + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + proxy_set_header X-Forwarded-For $real_ip; + proxy_set_header X-Forwarded-Host $real_ip; + proxy_set_header X-Real-IP $real_ip; + proxy_set_header Host $host; + proxy_pass http://integrations-openreplay:8080; + proxy_read_timeout 300; + proxy_connect_timeout 120; + proxy_send_timeout 300; + # CORS Headers + add_header 'Access-Control-Allow-Origin' '*'; + add_header 'Access-Control-Allow-Methods' 'POST,PATCH,OPTIONS,DELETE'; + add_header 'Access-Control-Allow-Headers' 'Content-Type,Authorization,Content-Encoding,X-Openreplay-Batch'; + add_header 'Access-Control-Expose-Headers' 'Content-Length'; + } location /api/ { rewrite ^/api/(.*) /$1 break;