Answer the question
In order to leave comments, you need to log in
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;
}
if ($args ~* timeout=(.+)) {
set $args ?request_timeout=$1;
rewrite ^(.*)$ $1$args break;
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question