|
1 | 1 | { |
2 | 2 | auto_https off |
3 | 3 | } |
4 | | -:2015 |
5 | | - |
6 | | -root * /srv |
7 | | -file_server |
8 | | - |
9 | | - |
10 | | -log { |
11 | | - level INFO |
12 | | -} |
13 | | -encode gzip |
14 | | -try_files {path} /index.html |
15 | | -templates /static/js/* { |
16 | | - mime application/javascript |
17 | | -} |
18 | | - |
19 | | -header /service-worker.js { |
20 | | - Cache-Control max-age=0,no-cache,no-store,must-revalidate |
21 | | -} |
22 | | - |
23 | | -header /index.html { |
24 | | - Cache-Control max-age=0,no-cache,no-store,must-revalidate |
25 | | -} |
26 | | - |
27 | | -header /static/* { |
28 | | - Cache-Control max-age=604800,public |
29 | | -} |
30 | | - |
31 | | -header /images/* { |
32 | | - Cache-Control max-age=604800,public |
33 | | -} |
34 | | - |
35 | | -header /manifest.json { |
36 | | - Cache-Control max-age=3600 |
| 4 | +:2015 { |
| 5 | + root * /srv |
| 6 | + log { |
| 7 | + level INFO |
| 8 | + } |
| 9 | + |
| 10 | + # Enable templates and include JS MIME for {env.VAR} substitution |
| 11 | + templates { |
| 12 | + mime text/html application/javascript |
| 13 | + } |
| 14 | + |
| 15 | + # Compress everything except JS (JS is already minified) |
| 16 | + @compressible { |
| 17 | + not path /static/js/* |
| 18 | + } |
| 19 | + encode @compressible gzip |
| 20 | + |
| 21 | + try_files {path} /index.html |
| 22 | + file_server |
| 23 | + |
| 24 | + # Your headers... |
| 25 | + header /service-worker.js { |
| 26 | + Cache-Control max-age=0,no-cache,no-store,must-revalidate |
| 27 | + } |
| 28 | + header /index.html { |
| 29 | + Cache-Control max-age=0,no-cache,no-store,must-revalidate |
| 30 | + } |
| 31 | + header /static/* { |
| 32 | + Cache-Control max-age=604800,public |
| 33 | + } |
| 34 | + header /images/* { |
| 35 | + Cache-Control max-age=604800,public |
| 36 | + } |
| 37 | + header /manifest.json { |
| 38 | + Cache-Control max-age=3600 |
| 39 | + } |
37 | 40 | } |
0 commit comments