如何在fastcgi通过之前删除路径中的前导斜杠而无需在nginx中进行重定向

时间:2018-12-03 18:21:39

标签: nginx nginx-location nginx-reverse-proxy

我想从中提供相同的php app(Laravel)内容 “ example.com/test / ...”和 “ example.com//test / ...”我想以任何一种方式将“ example.com/test / ...”发送到应用。

以下是我当前配置中有关服务器块的摘录

location / {
        try_files $uri $uri/ /index.php?$query_string;
}

location ~ \.php$ {
        fastcgi_split_path_info ^(.+\.php)(/.+)$;
        fastcgi_pass 127.0.0.1:9000;
        fastcgi_index index.php;
        fastcgi_param SCRIPT_FILENAME 
        $realpath_root$fastcgi_script_name;
}

0 个答案:

没有答案
相关问题