thr.vchangyi.com.conf
2.29 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
65
66
67
68
69
70
71
72
73
74
75
76
77
server {
listen 80;
error_log /data/wwwlogs/qy.nginx_error.log error;
server_name thr.vchangyi.com;
index index.html index.htm index.php;
root /data/wwwroot/thr.vchangyi.com/www;
location ~* ^.+.(jpg|jpeg|gif|css|png|js|ico|thumb|xml|swf|txt|woff|ttf|eot|svg|otf|htm|html|apk|map)$ {
# 微信前端 h5
if ($request_uri ~ ^/([^/]+)/([^/]+)/h5/index.html) {
rewrite ^/([^/]+)/([^/]+)/h5 /$2/h5/index.html break;
}
if ($request_uri ~ ^/([^/]+)/([^/]+)/h5/index-dev.html) {
rewrite ^/([^/]+)/([^/]+)/h5 /$2/h5/index-dev.html break;
}
if ($request_uri ~ ^/([^/]+)/([^/]+)/h5/(.*)(jpg|jpeg|gif|css|png|js|ico|thumb|xml|swf|txt|woff|ttf|eot|svg|otf|apk)) {
rewrite ^/([^/]+)/([^/]+)/h5/(.*) /$2/h5/$3 break;
}
access_log /dev/null;
expires 10d;
}
location / {
index index.html index.htm index.php;
access_log /data/wwwlogs/thr.vchangyi.com-access.log combined buffer=32k;
if ($request_uri ~ ^/([^/]+)/([^/]+)/h5) {
rewrite ^/([^/]+)/([^/]+)/h5 /$2/h5/index.html break;
}
if ($request_uri ~ ^/admincp) {
rewrite ^/admincp /admincp/index.html break;
}
if (!-e $request_filename) {
rewrite ^/(.*)$ /index.php last;
break;
}
}
location ~ [^/]\.php(/|$) {
try_files $uri =404;
chunked_transfer_encoding off;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
include fastcgi.conf;
# 设置 PATH_INFO 并改写 SCRIPT_FILENAME, SCRIPT_NAME 服务器环境变量
set $path_info "";
set $real_script_name $fastcgi_script_name;
if ($fastcgi_script_name ~ "^(.+\.php)(/.+)$") {
set $real_script_name $1;
set $path_info $2;
}
fastcgi_param PATH_INFO $path_info;
fastcgi_param SCRIPT_FILENAME $document_root$real_script_name;
fastcgi_param SCRIPT_NAME $real_script_name;
}
location /nginx_status {
stub_status on;
access_log off;
}
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$ {
expires 30d;
}
location ~ .*\.(js|css)?$ {
expires 12h;
}
access_log /data/wwwlogs/thr.vchangyi.com-access.log access;
}