I have a script that load images from an external server. This script runs on many different websites and what I need is that every click on the image will be proxied so it seems that the click comes from myapp
without passing any information of the origin to the external server. The only information I would like to pass are the User IP
and the User-Agent
I have no control over the external server, but from their dashboard I can see that many clicks are properly masked, while some pass the origin information and I have no idea why.
Here is my nginx.conf
location /rvsprx {
proxy_set_header Referer "https://www.myapp.com";
proxy_set_header Origin "https://www.myapp.com";
proxy_hide_header Set-Cookie;
proxy_ignore_headers Set-Cookie;
proxy_set_header Cookie "";
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Real-IP $remote_addr;
#use google as dns
resolver 8.8.8.8;
proxy_pass $arg_dest;
}
This is an example of the HTML created by the script on somesite.com
<a href="https://www.myapp.com/rvsprx?dest=https://www.externalserver.com/landing.html">
<img src="https://www.myapp.com/rvsprx?dest=https://www.externalserver.com/someimage.jpg"
</a>
How can I properly mask the origin?
There are other ways to pass information than Referer
, Origin
and Cookie
?
Thanks in advance.