Answer the question
In order to leave comments, you need to log in
Nginx: how to properly pass query_string to header?
Good afternoon,
there is a site, a request like "GET /parameter?some_arg=aaabbbxxx" arrives in it.
It is necessary for the following to happen, the request is cut to "GET /parameter" , and the value of the some_arg parameter is written to the header with the same name.
Did it like this:
location /parameter {
if ($arg_some_arg ~ (.*)$){
add_header some_arg $1;
rewrite ^(.*)$ $uri? permanent;
}
proxy_pass http://backend:
other proxy settings;
}
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