nginx: sub_filter to rewrite Kuma asset paths, fix monitor proxying
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
b1bf0e3af1
commit
05fa11b29a
1 changed files with 18 additions and 1 deletions
19
nginx.conf
19
nginx.conf
|
|
@ -18,14 +18,31 @@ server {
|
||||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Kuma assets and websocket — must come before /monitor/ to match first
|
||||||
|
location /monitor/assets/ {
|
||||||
|
proxy_pass http://10.10.10.105:3002/assets/;
|
||||||
|
proxy_set_header Host $host;
|
||||||
|
}
|
||||||
|
location /monitor/socket.io/ {
|
||||||
|
proxy_pass http://10.10.10.105:3002/socket.io/;
|
||||||
|
proxy_set_header Host $host;
|
||||||
|
proxy_set_header Upgrade $http_upgrade;
|
||||||
|
proxy_set_header Connection "upgrade";
|
||||||
|
proxy_http_version 1.1;
|
||||||
|
}
|
||||||
location /monitor/ {
|
location /monitor/ {
|
||||||
proxy_pass http://10.10.10.105:3002/monitor/;
|
proxy_pass http://10.10.10.105:3002/;
|
||||||
proxy_set_header Host $host;
|
proxy_set_header Host $host;
|
||||||
proxy_set_header X-Real-IP $remote_addr;
|
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 Upgrade $http_upgrade;
|
proxy_set_header Upgrade $http_upgrade;
|
||||||
proxy_set_header Connection "upgrade";
|
proxy_set_header Connection "upgrade";
|
||||||
proxy_http_version 1.1;
|
proxy_http_version 1.1;
|
||||||
|
# Rewrite Kuma's absolute /assets/ and /socket.io/ refs to /monitor/*
|
||||||
|
proxy_set_header Accept-Encoding "";
|
||||||
|
sub_filter '"/assets/' '"/monitor/assets/';
|
||||||
|
sub_filter '"/socket.io/' '"/monitor/socket.io/';
|
||||||
|
sub_filter_once off;
|
||||||
}
|
}
|
||||||
|
|
||||||
location /deploy/ {
|
location /deploy/ {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue