-
Notifications
You must be signed in to change notification settings - Fork 101
/
Copy pathwordpress-4-supercache.conf
84 lines (65 loc) · 1.74 KB
/
wordpress-4-supercache.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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
root /home/u1/domains/example.com;
set $cache_uri $request_uri;
if ($request_method = POST) {
set $cache_uri 'null cache';
}
if ($query_string != "") {
set $cache_uri 'null cache';
}
if ($request_uri ~* "(/wp-admin/|/xmlrpc.php|/wp-(app|cron|login|register|mail).php|wp-.*.php|/feed/|index.php|wp-comments-popup.php|wp-links-opml.php|wp-locations.php|sitemap(_index)?.xml|[a-z0-9_-]+-sitemap([0-9]+)?.xml)") {
set $cache_uri 'null cache';
}
if ($http_cookie ~* "comment_author|wordpress_[a-f0-9]+|wp-postpass|wordpress_logged_in") {
set $cache_uri 'null cache';
}
location ~ /\. {
deny all;
}
location = /favicon.ico {
log_not_found off;
access_log off;
}
location = /robots.txt {
allow all;
log_not_found off;
access_log off;
}
location / {
try_files /wp-content/cache/supercache/$http_host/$cache_uri/index.html $uri $uri/ /index.php?$query_string;
}
location ~ ^/wp-admin/includes/ {
deny all;
}
location ~* /wp-includes/js/tinymce/wp-tinymce.php {
allow all;
include fastcgi.conf;
fastcgi_intercept_errors on;
fastcgi_pass unix:/var/run/php5-example.com.sock;
}
location ~* /wp-includes/.*\.(php|php3|php4|php5|php6|phps|phtml)$ {
deny all;
}
location ~* /wp-content/.*\.(php|php3|php4|php5|php6|phps|phtml)$ {
deny all;
}
location ~* /modules/.*\.(php|php3|php4|php5|php6|phps|phtml)$ {
deny all;
}
location ~* /skins/.*\.(php|php3|php4|php5|php6|phps|phtml)$ {
deny all;
}
location = /xmlrpc.php {
deny all;
}
location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ {
expires max;
log_not_found off;
}
location ~* /(?:uploads|files)/.*\.(php|php3|php4|php5|php6|phps|phtml)$ {
deny all;
}
location ~ \.php$ {
include fastcgi.conf;
fastcgi_intercept_errors on;
fastcgi_pass unix:/var/run/php5-example.com.sock;
}