Files
archy/docker/archipelago-source/nginx.conf
T

58 lines
2.0 KiB
Nginx Configuration File

server {
# Host networking is required for the loopback-only Archipelago RPC.
# Keep nginx itself on loopback so the authenticated app gate owns every
# externally reachable listener.
listen 127.0.0.1:8337;
server_name _;
root /usr/share/nginx/html;
index index.html;
location = /healthz {
access_log off;
default_type text/plain;
return 200 "ok\n";
}
# The authenticated node app gate owns this exact script. If that route is
# ever absent, fail closed instead of feeding the SPA HTML to a script tag
# and poisoning the browser cache with a successful text/html response.
location = /nostr-provider.js {
add_header Cache-Control "no-store" always;
return 404;
}
# Root and deep-link SPA fallbacks must pick up the current provider URL
# after an upgrade. Hashed JS/CSS assets keep their normal static caching.
location = /index.html {
add_header Cache-Control "no-store" always;
try_files $uri =404;
}
location = /manifest.webmanifest {
default_type application/manifest+json;
try_files $uri =404;
}
location = /app/archipelago-source/manifest.webmanifest {
default_type application/manifest+json;
rewrite ^/app/archipelago-source/(.*)$ /$1 break;
try_files $uri =404;
}
# The normal dashboard proxy strips this prefix before forwarding, while
# direct app-gate access preserves it. Supporting both keeps health/debug
# access useful without making launch depend on any particular interface.
location ^~ /app/archipelago-source/ {
rewrite ^/app/archipelago-source/(.*)$ /$1 break;
try_files $uri $uri/ /index.html;
add_header X-Content-Type-Options "nosniff" always;
add_header Referrer-Policy "strict-origin-when-cross-origin" always;
}
location / {
try_files $uri $uri/ /index.html;
add_header X-Content-Type-Options "nosniff" always;
add_header Referrer-Policy "strict-origin-when-cross-origin" always;
}
}