I don't know if I am going about this in the right way, but here's what I need to do. I have a website that's available on the internet. But I have some users who only have access to the intranet. I want to create a proxy to allow these users to access this one site. What I've set up right now is an Nginx set up where it listens for bproxy on aproxy.com and forwards the user to whatever the arguments are.
I've also set up the firewall to only allow access to the IP address 127.0.0.1.
I'm using proxy_pass http://$args, to redirect the user to the arguments in www.aproxy.com/bproxy?www.somesite.com. Now, if the argument is www.google.com, it is redirecting the user to www.google.com/bproxy?www.somesite.com. This obviously throws an error, since bproxy is not a path on somesite. What I would like, is for the browser to continue to show http://aproxy.com/bproxy?www.somesite.com, but for the user to see www.google.com.
This does not happen if I directly use http://aproxy.com/?www.somesite.com. Now the issue I'm facing is that any relative path in www.somesite.com like /img/imagei.gif becomes aproxy.com/img/image1.gif, instead of www.somesite.com/img/image1.gif.
I don't know how to proceed and would really appreciate some help.