-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnginx.conf
More file actions
58 lines (48 loc) · 2.35 KB
/
Copy pathnginx.conf
File metadata and controls
58 lines (48 loc) · 2.35 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
server {
listen 80;
server_name _;
root /usr/share/nginx/html;
# Keep Location headers relative so published host ports (e.g. :8080) survive redirects.
absolute_redirect off;
# Hashed Vite build output — never SPA-fallback. A missing file must 404
# (not return index.html as text/html), otherwise CDNs cache the HTML under
# the .js/.css URL and browsers fail with NS_ERROR_CORRUPTED_CONTENT /
# MIME mismatches.
location /assets/ {
try_files $uri =404;
add_header Cache-Control "public, max-age=31536000, immutable" always;
}
# Signing Layer — unbundled ES modules (same origin as branding)
# Strict CSP: no network egress, self scripts/styles only. frame-ancestors
# omitted so arbitrary Branding Layers may embed the signer iframe.
location /signer/src/ {
add_header Content-Security-Policy "default-src 'none'; script-src 'self'; style-src 'self'; connect-src 'none'; img-src 'none'; font-src 'none'; media-src 'none'; object-src 'none'; child-src 'none'; frame-src 'none'; worker-src 'none'; manifest-src 'none'; base-uri 'none'; form-action 'none'; upgrade-insecure-requests" always;
try_files $uri =404;
add_header Cache-Control "public, max-age=300" always;
}
location /signer/ {
add_header Content-Security-Policy "default-src 'none'; script-src 'self'; style-src 'self'; connect-src 'none'; img-src 'none'; font-src 'none'; media-src 'none'; object-src 'none'; child-src 'none'; frame-src 'none'; worker-src 'none'; manifest-src 'none'; base-uri 'none'; form-action 'none'; upgrade-insecure-requests" always;
try_files $uri $uri/ /signer/index.html;
}
location = /signer {
return 301 /signer/;
}
# First-party passkey create host (Safari cross-origin iframe workaround)
location /create/ {
try_files $uri $uri/ /create/index.html;
}
location = /create {
return 301 /create/;
}
# HTML entry points — avoid long CDN caches so deploys pick up new asset hashes
location = /index.html {
add_header Cache-Control "no-cache" always;
}
location = /create/index.html {
add_header Cache-Control "no-cache" always;
}
# Branding Layer SPA at domain root (/signer/, /create/, /assets/ above take precedence)
location / {
try_files $uri $uri/ /index.html;
}
}