ssr
Gitea Actions Demo / build_and_push (push) Successful in 52s Details

This commit is contained in:
artem 2026-09-18 23:38:51 +03:00
parent 95687bda3a
commit 115bbae1ee
1 changed files with 6 additions and 9 deletions

View File

@ -39,17 +39,14 @@ http {
proxy_set_header Cookie $http_cookie; 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 = / { location = / {
hascookie token .;
if ($cookie_token = "") {
proxy_pass http://127.0.0.1:3001; proxy_pass http://127.0.0.1:3001;
proxy_set_header Host $host; 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; proxy_set_header Cookie $http_cookie;
} }
root /usr/share/nginx/html;
try_files /index.html =404;
}
# Everything else → SPA # Everything else → SPA
location / { location / {