fix mesh routing for handling resources
All checks were successful
CI / build-test (push) Successful in 44s
Deploy Staging (Docker) / deploy (push) Successful in 32s

This commit is contained in:
bachhungcb 2026-06-13 17:55:18 +07:00
parent 2cdeed2165
commit 91659f4575

View File

@ -154,10 +154,12 @@ server {
return 301 /api/meshcentral/proxy/;
}
location ~ ^/api/meshcentral/proxy/(.*)$ {
# Forward directly to MeshCentral via Tailscale HTTPS so MeshCentral receives
# requests over TLS and generates correct absolute URLs based on $meshhost.
proxy_pass https://soict-overleaf.tailc51e09.ts.net:8443/$1$is_args$args;
# ^~ prefix match takes priority over ALL regex locations (including the
# static-asset cache rule below). Nginx strips /api/meshcentral/proxy/ from
# the URI and appends the remainder to the proxy URL, so
# /api/meshcentral/proxy/styles/style.css soict-overleaf:8443/styles/style.css.
location ^~ /api/meshcentral/proxy/ {
proxy_pass https://soict-overleaf.tailc51e09.ts.net:8443/;
proxy_ssl_verify off;
proxy_ssl_server_name on;
proxy_cookie_path / "/; HTTPOnly; Secure; SameSite=None";
@ -168,7 +170,6 @@ server {
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-Host $host;
# Keep browser navigation under /api/meshcentral/proxy/*.
proxy_redirect ~^https?://[^/]+(/.*)$ /api/meshcentral/proxy$1;
proxy_redirect ~^(/.*)$ /api/meshcentral/proxy$1;