mirror of
https://github.com/gadgethd/ukmesh.git
synced 2026-12-06 03:14:09 +00:00
84 lines
3.4 KiB
Plaintext
84 lines
3.4 KiB
Plaintext
# Mount these locations on a separate DEV origin. The enclosing server sets
|
|
# $corescope_projection, $ukmesh_app and $ukmesh_backend to fixed internal upstreams.
|
|
location = / {
|
|
if ($request_method !~ ^(GET|HEAD)$) { return 405; }
|
|
include /etc/nginx/ukmesh-ingress/public-proxy.inc;
|
|
proxy_pass $corescope_projection/corescope-app-shell;
|
|
}
|
|
|
|
location = /corescope/config.js {
|
|
if ($request_method !~ ^(GET|HEAD)$) { return 405; }
|
|
alias /etc/nginx/corescope-app/config.js;
|
|
default_type application/javascript;
|
|
expires -1;
|
|
}
|
|
|
|
location = /_projection-ready {
|
|
internal;
|
|
include /etc/nginx/ukmesh-ingress/public-proxy.inc;
|
|
proxy_method GET;
|
|
proxy_pass $corescope_projection/api/public-projection-ready;
|
|
}
|
|
|
|
location @projection-unavailable {
|
|
return 503;
|
|
}
|
|
|
|
# Keep operator, account, diagnostic, and write APIs outside the app origin.
|
|
# Add data routes here only after their projection contract is verified.
|
|
location ~ "^/corescope/api/(?:healthz|config/(?:client|map|regions|region-quick-picks|theme)|nodes(?:/search|/[0-9A-Fa-f]{64})?)$" {
|
|
if ($request_method !~ ^(GET|HEAD)$) { return 405; }
|
|
auth_request /_projection-ready;
|
|
error_page 403 500 = @projection-unavailable;
|
|
include /etc/nginx/ukmesh-ingress/public-proxy.inc;
|
|
rewrite ^/corescope(/api/.*)$ $1 break;
|
|
proxy_pass $corescope_projection$uri$is_args$args;
|
|
}
|
|
|
|
location = /corescope/ws {
|
|
if ($request_method != GET) { return 405; }
|
|
if ($http_upgrade !~* ^websocket$) { return 426; }
|
|
auth_request /_projection-ready;
|
|
error_page 403 500 = @projection-unavailable;
|
|
include /etc/nginx/ukmesh-ingress/public-proxy.inc;
|
|
proxy_set_header Upgrade $http_upgrade;
|
|
proxy_set_header Connection upgrade;
|
|
proxy_read_timeout 75s;
|
|
proxy_pass $corescope_projection/$is_args$args;
|
|
}
|
|
|
|
location ~ ^/corescope/static/(?<core_asset>[a-zA-Z0-9_./-]+\.(?:js|mjs|css|svg|png|webp|woff2?|ico))$ {
|
|
if ($request_method !~ ^(GET|HEAD)$) { return 405; }
|
|
alias /srv/corescope/public/$core_asset;
|
|
disable_symlinks on;
|
|
}
|
|
|
|
location = /icons/phosphor-sprite.svg {
|
|
if ($request_method !~ ^(GET|HEAD)$) { return 405; }
|
|
alias /srv/corescope/public/icons/phosphor-sprite.svg;
|
|
disable_symlinks on;
|
|
}
|
|
|
|
location ~ "^/api/(?:runtime-config|regions/summary|nodes/map|nodes/[0-9A-Fa-f]{64}/links|activity/timeline|observer-activity|observers/health|packets/recent|links/[0-9A-Fa-f]{64}:[0-9A-Fa-f]{64}/history|path-beta/(?:resolve|resolve-multi|multibyte-paths))$" {
|
|
if ($request_method !~ ^(GET|HEAD)$) { return 405; }
|
|
include /etc/nginx/ukmesh-ingress/public-proxy.inc;
|
|
proxy_pass $ukmesh_app$uri$is_args$args;
|
|
}
|
|
|
|
location ~ "^/(?:sw(?:-runtime)?\.js|manifest\.json|favicon\.svg|icons/(?:icon|maskable)-(?:192|512)\.png|terrain-tiles/[0-9]{1,2}/[0-9]{1,8}/[0-9]{1,8}\.png)$" {
|
|
if ($request_method !~ ^(GET|HEAD)$) { return 405; }
|
|
include /etc/nginx/ukmesh-ingress/public-proxy.inc;
|
|
proxy_pass $ukmesh_app$uri$is_args$args;
|
|
}
|
|
|
|
location ~ "^/rf-coverage/(?:meta\.json|progress\.json|tiles/(?:standard|precision|nodes/n[0-9a-f]{24})/[0-9]{1,5}-[0-9]{1,5}\.png)$" {
|
|
if ($request_method !~ ^(GET|HEAD)$) { return 405; }
|
|
auth_request /_projection-ready;
|
|
error_page 403 500 = @projection-unavailable;
|
|
include /etc/nginx/ukmesh-ingress/public-proxy.inc;
|
|
rewrite ^/rf-coverage(/.*)$ /internal/rf-coverage-public$1 break;
|
|
proxy_pass $ukmesh_backend$uri$is_args$args;
|
|
}
|
|
|
|
location / { return 404; }
|