As a learning exercise in order to understand more about reverse proxy. I decided to use my private cloud server as a reverse proxy server and try to bypass corporate firewall (when I am at work) to allow myself to access gmail.
I have came up with the following Proxy configuration (please dont mind the square brackets):
SSLProxyEngine on ProxyRequests Off ProxyVia Off [Proxy *] Order deny,allow Deny from all Allow from xxx.xxx.xxx [/Proxy] ProxyPreserveHost On ProxyPass /qqq https://www.google.com/accounts/ServiceLogin?service=mail ProxyPassReverse /qqq https://www.google.com/accounts/ServiceLogin?service=mail ProxyPass /qqqqq http://mail.google.com/mail ProxyPassReverse /qqqqq http://mail.google.com/mail
The outcomes of the above configuration as follows:
When I navigate to myserver.com/qqq, the backend server (Google) simply changes URL and redirects me to google.com. Although I have "ProxyPreserveHost On"
When I navigate to myserver.com/qqqqq, Google does 301 back to my proxy server, which redirects me again to Google and I end up in the loop.
I have read a number of posts here at stackoverflow, but could not extract any helpful info from them:
https://stackoverflow.com/questions/5277107/apache-reverse-proxy-changes-url
https://stackoverflow.com/questions/6385638/proxy-pass-follow-redirect-on-server
My questions here are:
How to prevent Google from changing the URL, and instead transparently display content
What can I do in order not end up in 301 loop between my proxy server and Google
If you think I have missed/omitted/misunderstand something, please do let me know
Thank you, Alex