Add web service worker loader
Build and deploy Flutter Web / build (push) Failing after 4m19s

This commit is contained in:
Ruslan Bakiev
2026-06-21 09:34:40 +07:00
parent c374797484
commit fca8004e8d
6 changed files with 185 additions and 4 deletions
+70 -2
View File
@@ -1,11 +1,52 @@
server {
listen 80;
server_name _;
gzip on;
gzip_comp_level 6;
gzip_min_length 1024;
gzip_vary on;
gzip_types
application/javascript
application/json
application/manifest+json
application/wasm
image/svg+xml
text/css
text/plain;
etag on;
root /usr/share/nginx/html;
index index.html;
client_max_body_size 25m;
location / {
try_files $uri $uri/ /index.html;
location = /index.html {
add_header Cache-Control "no-cache" always;
add_header Pragma "no-cache" always;
add_header Expires "0" always;
try_files /index.html =404;
}
location ~* ^/(bootstrap\.js|sw\.js)$ {
add_header Cache-Control "no-cache" always;
add_header Pragma "no-cache" always;
add_header Expires "0" always;
try_files $uri =404;
}
location ~* ^/(manifest\.json|version\.json)$ {
add_header Cache-Control "no-cache" always;
add_header Pragma "no-cache" always;
add_header Expires "0" always;
try_files $uri =404;
}
location ~* ^/(flutter_service_worker\.js|flutter_bootstrap\.js|flutter\.js)$ {
add_header Cache-Control "no-cache" always;
add_header Pragma "no-cache" always;
add_header Expires "0" always;
return 410;
}
location = /graphql {
@@ -25,4 +66,31 @@ server {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
location ~* ^/assets/.*\.(otf|ttf|woff|woff2)$ {
add_header Cache-Control "public, max-age=31536000, immutable" always;
add_header Access-Control-Allow-Origin "*" always;
types {
font/otf otf;
font/ttf ttf;
font/woff woff;
font/woff2 woff2;
}
try_files $uri =404;
}
location ~* ^/(assets|canvaskit|icons)/ {
add_header Cache-Control "public, max-age=31536000, immutable" always;
try_files $uri =404;
}
location ~* \.(js|mjs|wasm|json|png|jpg|jpeg|gif|webp|svg|ico|woff|woff2|ttf)$ {
add_header Cache-Control "public, max-age=31536000, immutable" always;
try_files $uri =404;
}
location / {
add_header Cache-Control "no-cache" always;
try_files $uri $uri/ /index.html;
}
}