-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnginx.vh.conf.tpl
More file actions
64 lines (49 loc) · 1.8 KB
/
nginx.vh.conf.tpl
File metadata and controls
64 lines (49 loc) · 1.8 KB
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
server {
listen ${SITE_PORT};
error_log /var/log/nginx/error_log warn;
access_log /var/log/nginx/access.log main;
server_name ${SITE_HOST};
client_max_body_size 200M;
root ${SITE_ROOT};
index index.php;
location ~* /(?:uploads|files)/.*\.php$ {
deny all;
}
location ~* \.(engine|inc|info|install|make|module|profile|test|po|sh|.*sql|theme|tpl(\.php)?|xtmpl)$|^(\..*|Entries.*|Repository|Root|Tag|Template)$|\.php_ {
return 403;
}
location ~* \.(pl|cgi|py|sh|lua)\$ {
return 403;
}
location ~ /(\.|wp-config.php|wp-comments-post.php|xmlrpc.php|readme.html|license.txt) {
deny all;
}
location / {
try_files $uri $uri/ /index.php?$args /public/index.php?$args;
}
location /images/ {
valid_referers none blocked www.${SITE_HOST} ${SITE_HOST};
if ($invalid_referer) {
return 403;
}
}
location ~ /\. { deny all; access_log off; log_not_found off; }
location ~ /(shell|schema|puphpet) { deny all; access_log off; log_not_found off; }
location ~ /\/dev { deny all; access_log off; log_not_found off; }
location ~ \.php$ { ## Execute PHP scripts
if (!-e $request_filename) { rewrite / /index.php last; } ## Catch 404s that try_files miss
expires off; ## Do not cache dynamic content
fastcgi_pass ${FASTCGI_PATH};
fastcgi_index index.php;
fastcgi_param HTTP_RANGE $http_range;
fastcgi_param SERVER_NAME $http_host;
fastcgi_param QUERY_STRING $query_string;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_read_timeout ${FASTCGI_READ_TIMEOUT};
include fastcgi_params; ## See /etc/nginx/fastcgi_params
}
}