From 115bbae1eed7f98d6bd7d524bd8dba208971c4ce Mon Sep 17 00:00:00 2001 From: artem Date: Fri, 18 Sep 2026 23:38:51 +0300 Subject: [PATCH] ssr --- nginx.conf | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/nginx.conf b/nginx.conf index 0378f5a..9ea3f26 100644 --- a/nginx.conf +++ b/nginx.conf @@ -39,16 +39,13 @@ http { proxy_set_header Cookie $http_cookie; } - # Landing page: SSR if no auth cookie, SPA if has token + # Landing page — always SSR (server checks auth cookie, redirects if present) location = / { - hascookie token .; - if ($cookie_token = "") { - proxy_pass http://127.0.0.1:3001; - proxy_set_header Host $host; - proxy_set_header Cookie $http_cookie; - } - root /usr/share/nginx/html; - try_files /index.html =404; + proxy_pass http://127.0.0.1:3001; + 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 Cookie $http_cookie; } # Everything else → SPA