This commit is contained in:
+70
-2
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user