How to change $request_uri in nginx?

前端 未结 1 878
清歌不尽
清歌不尽 2021-01-12 02:48

We get information from $_SERVER[\'REQUEST_URI\'] not from $_GET or $_POST.

I want to define $request_uri to chan

相关标签:
1条回答
  • 2021-01-12 03:21
    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;
    }
    
    0 讨论(0)
提交回复
热议问题