dev_app.conf
2.11 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
server {
listen 80;
server_name qy.vchangyi.org;
root /cyphp/trunk/www;
index index.php;
location / {
index index.html index.htm index.php;
# access_log /data/wwwlogs/qy.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/$1 last;
break;
}
}
location ~ [^/]\.php(/|$) {
# comment try_files $uri =404; to enable pathinfo
try_files $uri =404;
fastcgi_pass php:8000;
fastcgi_index index.php;
include fastcgi.conf;
#include pathinfo.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;
}
access_log /dev/null;
expires 10d;
}
location /nginx_status {
stub_status on;
access_log off;
}
# 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 ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$ {
# expires 30d;
# }
# location ~ .*\.(js|css)?$ {
# expires 12h;
# }
}