-
Notifications
You must be signed in to change notification settings - Fork 0
/
enabler.conf
30 lines (28 loc) · 1.1 KB
/
enabler.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
location / {
error_page 418 = @cachemiss;
error_page 419 = @mobileaccess;
recursive_error_pages on;
if ($request_method = POST) { return 418; }
if ($arg_s != "") { return 418; }
if ($arg_p != "") { return 418; }
if ($args ~ "amp") { return 418; }
if ($arg_preview = "true") { return 418; }
if ($arg_ao_noptimize != "") { return 418; }
if ($http_cookie ~* "wordpress_logged_in_") { return 418; }
if ($http_cookie ~* "comment_author_") { return 418; }
if ($http_cookie ~* "wp_postpass_") { return 418; }
try_files "/wp-content/cache/cache-enabler/$host${uri}index.html" $uri $uri/ /index.php$is_args$args;
add_header "X-Cache" "HIT";
expires 30m;
add_header "Cache-Control" "must-revalidate";
}
location @mobileaccess {
try_files "/wp-content/cache/supercache/$host${uri}index$https_suffix-mobile.html" $uri $uri/ /index.php$is_args$args;
add_header "X-Cache" "HIT";
expires 30m;
add_header "Cache-Control" "must-revalidate";
}
location @cachemiss {
try_files $uri $uri/ /index.php$is_args$args;
}
include /etc/nginx/extra/staticfiles.conf;