File tree Expand file tree Collapse file tree 1 file changed +16
-19
lines changed Expand file tree Collapse file tree 1 file changed +16
-19
lines changed Original file line number Diff line number Diff line change 1
1
server {
2
- listen 80 default_server ;
2
+ listen 80 ;
3
3
4
- gzip on ;
5
- gzip_min_length 1000 ;
6
- gzip_types text/plain text/xml application/javascript text/css;
4
+ root /app;
5
+ index index.html;
7
6
8
- root /app;
7
+ gzip on ;
8
+ gzip_static on ;
9
+ gzip_comp_level 5 ;
10
+ gzip_min_length 1024 ;
11
+ gzip_types text/plain text/css application/javascript application/json image/svg+xml font/woff2;
9
12
10
- # normal routes
11
- # serve given url and default to index.html if not found
12
- # e.g. /, /user and /foo/bar will return index.html
13
- location / {
14
- add_header Cache-Control "no-store" ;
15
- try_files $uri $uri /index.html /index.html;
16
- }
13
+ location / {
14
+ try_files $uri /index.html;
15
+ add_header Cache-Control "no-cache, must-revalidate" ;
16
+ }
17
17
18
- # files
19
- # for all routes matching a dot, check for files and return 404 if not found
20
- # e.g. /file.js returns a 404 if not found
21
- location ~ \.(?!html) {
22
- add_header Cache-Control "public, max-age=2678400" ;
23
- try_files $uri =404 ;
24
- }
18
+ location ~* \.(?:js|css|woff2?|eot|ttf|otf|ico|jpg|jpeg|png|gif|svg)$ {
19
+ try_files $uri =404 ;
20
+ add_header Cache-Control "public, max-age=31536000, immutable" ;
21
+ }
25
22
}
You can’t perform that action at this time.
0 commit comments