change nginx for handling mesh seerver refractor
This commit is contained in:
parent
8d40607738
commit
fae5908213
|
|
@ -154,11 +154,8 @@ server {
|
|||
return 301 /api/meshcentral/proxy/;
|
||||
}
|
||||
|
||||
location ^~ /api/meshcentral/proxy/ {
|
||||
# Forward directly to MeshCentral, but strip proxy prefix first.
|
||||
# Without this, upstream sees /api/meshcentral/proxy/* and can redirect-loop.
|
||||
rewrite ^/api/meshcentral/proxy/(.*)$ /$1 break;
|
||||
proxy_pass http://$meshserver;
|
||||
location ~ ^/api/meshcentral/proxy/(.*)$ {
|
||||
proxy_pass http://$meshserver/$1$is_args$args;
|
||||
proxy_cookie_path / "/; HTTPOnly; Secure; SameSite=None";
|
||||
|
||||
proxy_set_header Host $meshhost;
|
||||
|
|
|
|||
|
|
@ -35,13 +35,8 @@ function RemoteControlPage() {
|
|||
onSuccess: (data) => {
|
||||
setErrorMessage(null);
|
||||
|
||||
// Chuyển URL MeshCentral thành proxy URL
|
||||
const originalUrl = new URL(data.url);
|
||||
const pathAndQuery = originalUrl.pathname + originalUrl.search;
|
||||
const proxyUrlFull = buildMeshProxyUrl(pathAndQuery);
|
||||
|
||||
console.log("[RemoteControl] Proxy URL:", proxyUrlFull);
|
||||
setProxyUrl(proxyUrlFull);
|
||||
console.log("[RemoteControl] URL:", data.url);
|
||||
setProxyUrl(data.url);
|
||||
setShowRemote(true);
|
||||
},
|
||||
onError: (error: any) => {
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user