From 3654f815bca5aba0835af227f2203dd64389e174 Mon Sep 17 00:00:00 2001 From: Andras Bacsai <5845193+andrasbacsai@users.noreply.github.com> Date: Sat, 22 Aug 2026 13:33:51 +0200 Subject: [PATCH] fix(nginx): restrict realtime websocket location to /app/ --- docker/development/etc/nginx/site-opts.d/http.conf | 2 +- docker/production/etc/nginx/site-opts.d/http.conf | 2 +- tests/Feature/RealtimeTerminalPackagingTest.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docker/development/etc/nginx/site-opts.d/http.conf b/docker/development/etc/nginx/site-opts.d/http.conf index bd5218cf7b..94d26f55b2 100644 --- a/docker/development/etc/nginx/site-opts.d/http.conf +++ b/docker/development/etc/nginx/site-opts.d/http.conf @@ -30,7 +30,7 @@ location /healthcheck { } # Proxy Coolify's websocket services through the same endpoint as the dashboard. -location ^~ /app { +location ^~ /app/ { proxy_pass http://coolify-realtime:6001; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; diff --git a/docker/production/etc/nginx/site-opts.d/http.conf b/docker/production/etc/nginx/site-opts.d/http.conf index bd5218cf7b..94d26f55b2 100644 --- a/docker/production/etc/nginx/site-opts.d/http.conf +++ b/docker/production/etc/nginx/site-opts.d/http.conf @@ -30,7 +30,7 @@ location /healthcheck { } # Proxy Coolify's websocket services through the same endpoint as the dashboard. -location ^~ /app { +location ^~ /app/ { proxy_pass http://coolify-realtime:6001; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; diff --git a/tests/Feature/RealtimeTerminalPackagingTest.php b/tests/Feature/RealtimeTerminalPackagingTest.php index 58bc6073d1..a647a544e0 100644 --- a/tests/Feature/RealtimeTerminalPackagingTest.php +++ b/tests/Feature/RealtimeTerminalPackagingTest.php @@ -2,7 +2,7 @@ it('proxies realtime websocket traffic through the bundled nginx server', function (string $environment) { $nginxConfiguration = file_get_contents(base_path("docker/{$environment}/etc/nginx/site-opts.d/http.conf")); - $locationFound = preg_match('/location \^~ \/app \{(?.*?)\n\}/s', $nginxConfiguration, $location); + $locationFound = preg_match('/location \^~ \/app\/ \{(?.*?)\n\}/s', $nginxConfiguration, $location); expect($locationFound) ->toBe(1)