-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwordpress_secure.conf
56 lines (53 loc) · 1.19 KB
/
wordpress_secure.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
include /etc/nginx/wordpress/disable_user_api.conf;
rewrite /wp-admin$ $scheme://$host$uri/ permanent;
location /wp-includes/{
location ~ \.(gz|tar|bzip2|7z|php|php5|php7|log|error|py|pl|kid|love|cgi)$ {
deny all;
}
}
location /wp-content/uploads {
location ~ \.(gz|tar|bzip2|7z|php|php5|php7|log|error|py|pl|kid|love|cgi)$ {
deny all;
}
}
location /wp-content/updraft {
deny all;
}
location /wp-content/uploads/sucuri {
deny all;
}
location /wp-content/uploads/nginx-helper {
deny all;
}
location = /wp-config.php {
deny all;
}
location = /wp-links-opml.php {
deny all;
}
location = /wp-config-sample.php {
deny all;
}
location = /wp-comments-post.php {
deny all;
}
location = /readme.html {
deny all;
}
location = /license.txt {
deny all;
}
# enable gzip on static assets - php files are forbidden
location /wp-content/cache {
# Cache css & js files
location ~* \.(?:css(\.map)?|js(\.map)?|.html)$ {
add_header Access-Control-Allow-Origin *;
access_log off;
log_not_found off;
expires 97d;
}
location ~ \.php$ {
#Prevent Direct Access Of PHP Files From Web Browsers
deny all;
}
}