T
T
timuritto2016-09-20 12:34:57
Nginx
timuritto, 2016-09-20 12:34:57

How to rewrite uri using nginx?

URI /WCP_TEST00/ru_RU/?N="WebUser"&P=&C="code=codecs
Must be changed to /WCP_TEST00/ru_RU/?N="WebUser"&P=&C="code : codecs "
make upstream to server_name2
do this
location / {
rewrite_log on;
rewrite ^/(.*code)=(.*)$ $1:$2";
proxy_pass https://server_name2;
}

Answer the question

In order to leave comments, you need to log in

1 answer(s)
T
timuritto, 2016-09-20
@timuritto

Maybe someone needs. I did this:
location / {
rewrite_log on;
if ($request_uri ~ ^/(.*code)%3D(.*)$ ) {
set $request_url $1%3A$2%22;
}
proxy_pass https://server_name2/$request_url;

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question