我们从$_SERVER [‘REQUEST_URI’]获取的信息不是来自$_GET或$_POST.
我想定义$request_uri来将/ example更改为/ module / controller / action.请注意,我不想触发重定向.
我尝试了下面的代码来做到这一点,但它不起作用.
location /example {
rewrite /module/controller/action;
}
set $request_url $request_uri;
if ($request_uri ~ ^/example(.*)$) {
set $request_url /module/controller/action;
}
location ~ \.PHP${
fastcgi_pass 127.0.0.1:9090;
#include fastcgi.conf;
fastcgi_param REQUEST_URI $request_url;
#fastcgi_param REQUEST_URI $request_uri;
}