English 中文(简体)
• 如何避免以白空间代替%20(镜头)?
原标题:how to avoid nginx to replace %20 by whitespace when using as a proxy (proxy_pass) ?
  • 时间:2012-01-12 16:51:58
  •  标签:
  • nginx

我正在使用一个 n子作为代理,用于一个pache服务器。

这里是我召集的:

location ~ ^/subsite/(.*)$ {
        proxy_pass http://127.0.0.1/subsite/$1?$query_string;
    }

问题在于,如果我提出过像我的网站.com/subsite/variable/ Remuneration/Access%20denied/another/example一样的20份申请。

the %20 is replaced by a whitespace, and apache don t care about all the end of the request after Access /title/Access

任何想法?

问题回答

我能够解决一个类似的问题——我们有一只需要搜索条件才能成为URL道路的一部分。 直接将产出通过代理指令后,即使该请求被适当编码,它仍投下502份。

Here s the solution we came up with:

location ~ /api/search(/.*) {
        set $query $1;
        proxy_pass http://127.0.0.1:3003$query;

    }

“定型”指令似乎保持了ur式编码(或重新编码,从reg升到1美元)。





相关问题
nginx behaved differently for different version

I have used docker image nginx:1.18.0-alpine previously and below is the conf. It works as expected app.localhost --> points to the block wit server_name app.* localhost --> points to the other ...

What s limiting my PHP resources?

I m having a problem getting more memory out of PHP. This is the error message: Fatal error: Allowed memory size of 20971520 bytes exhausted (tried to allocate 82 bytes) in ... Yet: I ve set ...

what user I should run my nginx or php-fpm processes

Ok. Im little bit confused about those permissions in linux so please people help me out. The trouble is that I dont want to run server as root, so I created another user with sudo privileges so he ...

Nginx 301 redirect inc. set cookie

what I m looking for is the ability for nginx to detect that a url has the query string variable cid. for example www.adomain.com/froggy?cid=12&as=false (query string can be solo or mixed with ...

Nginx raises 404 when using format => js

I upload images to my App using Ajax and an Iframe. In Development everything works like a charm. But in production Nginx suddenly raises a 404 error. When I look into the log, the request never hits ...

nginx errors readv() and recv() failed

I use nginx along with fastcgi. I see a lot of the following errors in the error logs readv() failed (104: Connection reset by peer) while reading upstream and recv() failed (104: Connection ...

SSL slowness in EC2

We ve deployed our rails app to EC2. In our setup, we have two proxies on small instances behind round-robin DNS. These run nginx load balancers for a dynamically growing and shrinking farm of web ...

热门标签