/
blot-site.conf
41 lines (34 loc) · 1.17 KB
/
blot-site.conf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
access_log /var/www/blot/logs/nginx.log test;
root /cache;
# use $request_uri if you want the query string also
# use $uri if you don't
set $cache_permanent_folder /$host/$scheme/permanent$request_uri;
set $cache_blot_folder /$host/$scheme/temporary$request_uri;
set $cache_blot_folder_index /$host/$scheme/temporary$request_uri/index.html;
# This is used to determine whether the server is handling
# requests, don't remove it unless you change monit.rc too!
location = /health {
return 200;
}
# Stripe also sets a cookie so you
# can't just check if a cookie exists
# You have to check for the type of cookie
# set by Express which handles Blot's
# dashboard sessions.
if ($cookie_connect.sid) {
set $cache_blot_folder false;
set $cache_blot_folder_index false;
}
location / {
add_header 'Cache-Hit' 'true-permanent' always;
add_header 'Cache-Control' 'max-age=31536000' always;
try_files $cache_permanent_folder @temporary;
}
location @temporary {
add_header 'Cache-Control' '' always;
add_header 'Cache-Hit' 'true' always;
try_files $cache_blot_folder $cache_blot_folder_index @blot;
}
location @blot {
include /var/www/blot/config/nginx/reverse-proxy.conf;
}