From 41d548ee66f1a6a9fa885910a75795189def03f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Leandro=20Ant=C3=B4nio=20Farias=20Machado?= Date: Mon, 26 Jun 2023 01:41:30 -0300 Subject: [PATCH] chore(nginx):update nginx config for websockets --- devops/nginx.conf | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/devops/nginx.conf b/devops/nginx.conf index 301aa4a..597e147 100644 --- a/devops/nginx.conf +++ b/devops/nginx.conf @@ -77,7 +77,7 @@ http { proxy_set_header Host $host; proxy_cache_bypass $http_upgrade; } - location /api { + location /api { proxy_pass http://127.0.0.1:8001; proxy_read_timeout 60; proxy_connect_timeout 60; @@ -90,6 +90,19 @@ http { proxy_set_header Host $host; proxy_cache_bypass $http_upgrade; } + location /socket.io { + proxy_pass http://127.0.0.1:5000; + proxy_read_timeout 60; + proxy_connect_timeout 60; + proxy_redirect off; + + # Allow the use of websockets + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection 'upgrade'; + proxy_set_header Host $host; + proxy_cache_bypass $http_upgrade; + } error_page 500 502 503 504 /50x.html; location = /50x.html {