简体   繁体   English

Nginx配置try_files不传输所有获取字段

[英]nginx config try_files not transferring all get fields

I'm fairly new to nginx and after looking through documentation still can't find the solution to this problem. 我对nginx相当陌生,在浏览了文档后仍然找不到该问题的解决方案。 So I've got this: 所以我有这个:

        location ~/project/(\S+)/(\S+)/(\S+) {
            try_files $uri $uri/ /project/$1/api.php?p=$2&r=$3;
        }

I can obviously get the 2 get fields I've asked for there, but how can I change it so that I can use any additional specified when accessing that URL? 显然,我可以在那里获得我要求的2个get字段,但是如何更改它,以便在访问该URL时可以使用指定的其他任何内容? Currently, if I write the URL and add ?s=whatever it won't transfer that because of the nginx config. 目前,如果我编写URL并添加?s =,则由于nginx配置,它不会传输该URL。

Thanks. 谢谢。

The current query string is available as $args . 当前查询字符串可作为$args

For example: 例如:

try_files $uri $uri/ /project/$1/api.php?p=$2&r=$3&$args;

See this document for details. 有关详细信息,请参见此文档

得到了外部帮助,此方法有效:

try_files $uri $uri/ /project/$1/api.php?p=$2&r=$3&$args;

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM