<div dir="auto"><div><div class="gmail_quote"><div dir="ltr"><br></div><div dir="ltr">
<p>I have a simple nginx forward proxy, configured as:</p>
<pre><code>server {
listen 8000;
resolver 8.8.8.8;
location / {
proxy_pass http://$host;
proxy_set_header Host $host;
}
}
</code></pre>
<p>The client behind its isp firewall sends the request (per nginx log):
<code>GET <a href="http://www.clientisp.com/path/rewrite.do?url=http%3A%2F%2Fwww.example.com" target="_blank" rel="noreferrer">http://www.clientisp.com/path/rewrite.do?url=http%3A%2F%2Fwww.example.com</a> HTTP/1.1</code></p>
<p>How do I transform the requested url to <code><a href="http://www.example.com" target="_blank" rel="noreferrer">http://www.example.com</a></code> before it is sent to the upstream?</p>
<p>I looked up many posts online, but I am still confused at:</p>
<ol><li>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"<code>="</code>, <code>http%3A%2F%<a href="http://2Fwww.example.com" target="_blank" rel="noreferrer">2Fwww.example.com</a></code>.</li><li>I have no idea how to decode the percentage coded symbols into
normalized one.</li></ol>
<p>Thanks for your input!</p>
<br clear="all"><br>-- <br><div dir="ltr" class="m_5065605308368051610gmail_signature" data-smartmail="gmail_signature">.--- .. -. -.. .- -. --.. .... --- ..- <br></div></div>
</div></div></div>