D
D
demudrol2018-04-13 17:40:57
Nginx
demudrol, 2018-04-13 17:40:57

How to rewrite a request with a proxy pass?

There is a $request "POST /_bulk?timeout=30s HTTP/1.1"
I want to change this request to POST /_bulk?request_timeout =30s HTTP/1.1 and send the already changed one.
Config:

location / {
proxy_http_version 1.1;
proxy_set_header Connection "Keep-Alive";
proxy_set_header Proxy-Connection "Keep-Alive";
proxy_pass http://upstream_servers_http;
proxy_buffering on;
}

Tried
if ($args ~* timeout=(.+)) {
set $args ?request_timeout=$1;
rewrite ^(.*)$ $1$args break;
}

But it doesn't come out.
Tell me please

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question