68 lines
2.4 KiB
Plaintext
68 lines
2.4 KiB
Plaintext
server {
|
|
listen 80;
|
|
server_name _;
|
|
|
|
root /usr/share/nginx/html;
|
|
index index.html;
|
|
|
|
add_header Content-Security-Policy "frame-ancestors 'self'" always;
|
|
add_header X-Frame-Options "SAMEORIGIN" always;
|
|
|
|
location ~ ^/(release-entry|release-manifest)\.json$ {
|
|
add_header Cache-Control "no-store";
|
|
add_header Content-Security-Policy "frame-ancestors 'self'" always;
|
|
add_header X-Frame-Options "SAMEORIGIN" always;
|
|
try_files $uri =404;
|
|
}
|
|
|
|
location ~ ^/(master|beta|canary|internal)/frontend/(release-entry|release-manifest)\.json$ {
|
|
add_header Cache-Control "no-store";
|
|
add_header Content-Security-Policy "frame-ancestors 'self'" always;
|
|
add_header X-Frame-Options "SAMEORIGIN" always;
|
|
try_files /$2.json =404;
|
|
}
|
|
|
|
location ~ ^/(?:.+/)?(?<static_asset_path>(?:assets|resources|favicons|icons|img|sounds|\.well-known)/.+)$ {
|
|
add_header Cache-Control "public, max-age=31536000, immutable";
|
|
add_header Content-Security-Policy "frame-ancestors 'self'" always;
|
|
add_header X-Frame-Options "SAMEORIGIN" always;
|
|
try_files /$static_asset_path =404;
|
|
}
|
|
|
|
location ~ ^/(?:.+/)?(?<static_file_path>manifest\.json|manifest\.webmanifest|favicon\.ico|favicon_default\.ico|pleno-favicon\.ico|release-entry\.json|release-manifest\.json|registerSW\.js|sw\.js|workbox-[^/]+\.js)$ {
|
|
try_files /$static_file_path =404;
|
|
}
|
|
|
|
location ~ \.[^/]+$ {
|
|
try_files $uri =404;
|
|
}
|
|
|
|
location /assets/ {
|
|
add_header Cache-Control "public, max-age=31536000, immutable";
|
|
add_header Content-Security-Policy "frame-ancestors 'self'" always;
|
|
add_header X-Frame-Options "SAMEORIGIN" always;
|
|
try_files $uri =404;
|
|
}
|
|
|
|
location ~ ^/(master|beta|canary|internal)/frontend/assets/ {
|
|
add_header Cache-Control "public, max-age=31536000, immutable";
|
|
add_header Content-Security-Policy "frame-ancestors 'self'" always;
|
|
add_header X-Frame-Options "SAMEORIGIN" always;
|
|
rewrite ^/(master|beta|canary|internal)/frontend/(.*)$ /$2 break;
|
|
try_files $uri =404;
|
|
}
|
|
|
|
location ~ ^/(master|beta|canary|internal)/frontend$ {
|
|
try_files /index.html =404;
|
|
}
|
|
|
|
location ~ ^/(master|beta|canary|internal)/frontend/ {
|
|
rewrite ^/(master|beta|canary|internal)/frontend/(.*)$ /$2 break;
|
|
try_files $uri $uri/ /index.html;
|
|
}
|
|
|
|
location / {
|
|
try_files $uri $uri/ /index.html;
|
|
}
|
|
}
|