Forward proxy with masquerading
I need to do a demo related to identity management.
I have installed some software on a machine and want to let other people get a feel of the “simplified sign-on” experience.
And to make things more real, I want to use real domain names.
A user would point his web client to www.meteo.fr and gets redirected to my server machine where the magic of SSO should happen.
There are many ways to masquerade an IP address. You can ask the user to change the way domain names get resolved: e.g. /etc/hosts on Un*x systems. lmhosts on Windows machines. But this requires some complicated changes.
A better way — since we are doing HTTP –, is to tell the user to use a proxy.
The proxy will route your masqueraded URLs to the right destination while leaving the rest of the trafic unchanged.
How do I do that? I have been struggking of a few days, looking at mod_proxy and mod_rewrite. Here is one way to do it:
NameVirtualHost *:8666
# masquerade www.figaro.fr
<VirtualHost *:8666>
ServerName www.figaro.fr
ProxyPass / http://my.machine.com
ProxyPassReverse /
</VirtualHost>
# masquerade www.lemonde.fr
<VirtualHost *:8666>
ServerName www.lemonde.fr
ProxyPass / http://my.machine.com
ProxyPassReverse / http://www.yahoo.fr/
</VirtualHost>
# regular trafic
<VirtualHost *:8666>
ProxyRequests On
</VirtualHost>
