Welcome! Log In Create A New Profile

Advanced

Rewrite request url to match the query string and normalization

November 11, 2018 11:00AM
I have a simple nginx forward proxy, configured as:

server {
listen 8000;
resolver 8.8.8.8;
location / {
proxy_pass http://$host;
proxy_set_header Host $host;
}
}

The client behind its isp firewall sends the request (per nginx log): GET
http://www.clientisp.com/path/rewrite.do?url=http%3A%2F%2Fwww.example.com
HTTP/1.1

How do I transform the requested url to http://www.example.com before it is
sent to the upstream?

I looked up many posts online, but I am still confused at:

1. The online examples usually teach how you match the uri part, but my
goal is to obtain the queried string only, i.e., everything after the
equation mark"=", http%3A%2F%2Fwww.example.com.
2. I have no idea how to decode the percentage coded symbols into
normalized one.

Thanks for your input!


--
..--- .. -. -.. .- -. --.. .... --- ..-
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

Rewrite request url to match the query string and normalization

eN_Joy November 11, 2018 11:00AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 320
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready