-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathngx_string.conf
More file actions
24 lines (22 loc) · 938 Bytes
/
ngx_string.conf
File metadata and controls
24 lines (22 loc) · 938 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#演示在ng中进行字符串处理 -- 获取所需的子串
#http server location
#日志滚动
if ($time_iso8601 ~ "^(?<year>\d{4})-(?<month>\d{2})-(?<day>\d{2})") {}
access_log /var/log/nginx/access-$year$month$day.log main;
location ~ /demo {
root /var/opt/public;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
#fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param SCRIPT_FILENAME /var/opt/public/index.php;
include fastcgi_params;
if ( $request_uri ~ ^/demo/(.*)$ ) {
#生成所需字符串
set $r_uri $1;
set $d_uri $1;
}
#重写环境变量
fastcgi_param REQUEST_URI /$r_uri;
fastcgi_param DOCUMENT_URI /$d_uri;
fastcgi_param SCRIPT_NAME /index.php;
}