From 2dbec99c6fd96a31f35f4f5db296a6d1c299e654 Mon Sep 17 00:00:00 2001 From: Karishma Shukla Date: Sat, 26 Apr 2025 15:55:40 +0530 Subject: [PATCH 1/8] feat: _ server name --- nginx.conf | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/nginx.conf b/nginx.conf index 1ea521461..2e57dc53f 100644 --- a/nginx.conf +++ b/nginx.conf @@ -1,5 +1,6 @@ server { listen 80; + server_name _; location / { root /usr/share/nginx/html; @@ -42,4 +43,4 @@ server { proxy_intercept_errors on; error_page 502 503 504 /50x.html; } -} \ No newline at end of file +} From 84bad0c89d878e3a829a9e3381ff4c193032ce7f Mon Sep 17 00:00:00 2001 From: Karishma Shukla Date: Sat, 26 Apr 2025 15:56:40 +0530 Subject: [PATCH 2/8] feat: serve frontend --- nginx.conf | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/nginx.conf b/nginx.conf index 2e57dc53f..77282e652 100644 --- a/nginx.conf +++ b/nginx.conf @@ -2,8 +2,11 @@ server { listen 80; server_name _; + root /var/www/maxun; + index index.html; + + # Serve the frontend location / { - root /usr/share/nginx/html; try_files $uri $uri/ /index.html; } From 6b86d351497798d6ba04af9eb983ca28248d4e38 Mon Sep 17 00:00:00 2001 From: Karishma Shukla Date: Sat, 26 Apr 2025 15:58:00 +0530 Subject: [PATCH 3/8] feat: backend proxy --- nginx.conf | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/nginx.conf b/nginx.conf index 77282e652..29c6f9905 100644 --- a/nginx.conf +++ b/nginx.conf @@ -9,8 +9,9 @@ server { location / { try_files $uri $uri/ /index.html; } - - location /api { + + # Proxy for backend + location ^/(auth|storage|record|workflow|robot|proxy|api-docs)(/|$) { proxy_pass http://localhost:8080; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; From a67d93a37e4d648de842ce9d63ddf0d5d311cc74 Mon Sep 17 00:00:00 2001 From: Karishma Shukla Date: Sat, 26 Apr 2025 15:59:01 +0530 Subject: [PATCH 4/8] feat: handle websocket connections --- nginx.conf | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/nginx.conf b/nginx.conf index 29c6f9905..a48fba884 100644 --- a/nginx.conf +++ b/nginx.conf @@ -12,12 +12,15 @@ server { # Proxy for backend location ^/(auth|storage|record|workflow|robot|proxy|api-docs)(/|$) { - proxy_pass http://localhost:8080; + proxy_pass http://localhost:8080; # change as per your setup 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; + 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; + # Add timeout configurations proxy_connect_timeout 60s; From 69aedcb9ff93e65a3157fa590e629a0956618080 Mon Sep 17 00:00:00 2001 From: Karishma Shukla Date: Sat, 26 Apr 2025 17:09:35 +0530 Subject: [PATCH 5/8] chore: cleanup stale config --- nginx.conf | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/nginx.conf b/nginx.conf index a48fba884..23438209e 100644 --- a/nginx.conf +++ b/nginx.conf @@ -31,23 +31,4 @@ server { proxy_intercept_errors on; error_page 502 503 504 /50x.html; } - - location ~ ^/(record|workflow|storage|auth|integration|proxy|api-docs) { - proxy_pass http://localhost:8080; - proxy_http_version 1.1; - proxy_set_header Upgrade $http_upgrade; - proxy_set_header Connection 'keep-alive'; # Ensure connections remain open - proxy_set_header Connection 'upgrade'; - proxy_set_header Host $host; - proxy_cache_bypass $http_upgrade; - - # Timeout configurations - proxy_connect_timeout 60s; - proxy_send_timeout 60s; - proxy_read_timeout 60s; - - # Error handling for these routes - proxy_intercept_errors on; - error_page 502 503 504 /50x.html; - } } From 50ec36110ea907200a95766044fccfe71027c907 Mon Sep 17 00:00:00 2001 From: Karishma Shukla Date: Sat, 26 Apr 2025 17:11:15 +0530 Subject: [PATCH 6/8] chore: cleanup stale config --- nginx.conf | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/nginx.conf b/nginx.conf index 23438209e..8f168ac95 100644 --- a/nginx.conf +++ b/nginx.conf @@ -18,15 +18,9 @@ server { proxy_set_header Connection 'upgrade'; 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-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; - - # Add timeout configurations - proxy_connect_timeout 60s; - proxy_send_timeout 60s; - proxy_read_timeout 60s; - # Add error handling proxy_intercept_errors on; error_page 502 503 504 /50x.html; From 235d731ad2c5c026a62f0ebf418b51f105efad8a Mon Sep 17 00:00:00 2001 From: Karishma Shukla Date: Sat, 26 Apr 2025 17:11:31 +0530 Subject: [PATCH 7/8] feat: app api --- nginx.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nginx.conf b/nginx.conf index 8f168ac95..859c56861 100644 --- a/nginx.conf +++ b/nginx.conf @@ -11,7 +11,7 @@ server { } # Proxy for backend - location ^/(auth|storage|record|workflow|robot|proxy|api-docs)(/|$) { + location ^/(auth|storage|record|workflow|robot|proxy|api-docs|api)(/|$) { proxy_pass http://localhost:8080; # change as per your setup proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; From e3651046e7cc0e4553623e3766866a064094d4a0 Mon Sep 17 00:00:00 2001 From: Karishma Shukla Date: Mon, 28 Apr 2025 01:02:53 +0530 Subject: [PATCH 8/8] feat: -rm error handling --- nginx.conf | 4 ---- 1 file changed, 4 deletions(-) diff --git a/nginx.conf b/nginx.conf index 859c56861..c36514379 100644 --- a/nginx.conf +++ b/nginx.conf @@ -20,9 +20,5 @@ server { 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; - - # Add error handling - proxy_intercept_errors on; - error_page 502 503 504 /50x.html; } }