-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathnginx.conf
47 lines (34 loc) · 1.14 KB
/
nginx.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
log_format www.php0.net '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" $http_x_forwarded_for';
server
{
listen 80;
server_name php0.net www.php0.net;
index index.html index.htm index.php default.html default.htm default.php;
root /home/wwwroot/www.php0.net;
include other.conf;
if (!-e $request_filename) {
rewrite ^/(.*\.(js|ico|gif|jpg|png|css|bmp|wsdl|pdf|xls)$) /public/$1 last;
rewrite ^/(.*) /index.php?$1 last;
}
if ($http_user_agent ~ ApacheBench|webBench|Java/|http_load|must-revalidate|wget) {
return 403;
}
location ~ .*\.(php|php5)?$
{
try_files $uri =404;
fastcgi_pass unix:/tmp/php-cgi.sock;
fastcgi_index index.php;
include fcgi.conf;
}
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
{
expires 30d;
}
location ~ .*\.(js|css)?$
{
expires 12h;
}
access_log /home/wwwlogs/www.php0.net.log www.php0.net;
}