Using a reverse proxy to enable all features of advanced iframe pro

In the quickstart guide you have found out which setup you have and which features are available for you. If you are on a different domain and you cannot add the line of Javascript than you normally cannot use features like auto height, css modifications or auto zoom.

The last option you might have is that you setup a so called reverse proxy (http://en.wikipedia.org/wiki/Reverse_proxy). If you run your own server or your hoster does allow that you use mod_proxy (http://httpd.apache.org/docs/current/mod/mod_proxy.html) AND you have access to the server config you can map the page you want in the iframe to a url of your site. Proxypass is not supported when you can only use a .htaccess file!

There are many tutorials about this topic. In my example below I use Five b from the following page: http://serverfault.com/questions/561892/how-to-handle-relative-urls-correctly-with-a-reverse-proxy.
A more detailed tutorial can be found here: http://www.apachetutor.org/admin/reverseproxies. Details about proxypass and proxypassreverse can be found here http://httpd.apache.org/docs/2.4/mod/mod_proxy.html#proxypass

So a reverse proxy setup can be quite simple but also not working at all depending on the page you want to include. And it does require a lot of time and is really an advanced topic.

As example I show you how I setup a reverse proxy on my localhost for the main page of www.tinywebgallery.com.

1. Enable mod_proxy and mod_substitute in conf/httpd.conf
2. Add

<IfModule proxy_module>
    ProxyPass /twg/ http://www.tinywebgallery.com/
    ProxyPassReverse /twg/ http://www.tinywebgallery.com/
    <Location /twg/>
      AddOutputFilterByType SUBSTITUTE text/html
      Substitute "s|www.tinywebgallery.com/|localhost/twg/|i" 
    </Location> 
</IfModule>

to the Apache config (conf/httpd.conf or e.g. extra/httpd-proxy.conf).

3. Restart the server

www.tinywebgallery.com is now available at http://localhost/twg/ ;).

And now you would be able to use all features of Advanced iFrame Pro!

Best, Michael

Leave a Reply

Your email address will not be published. Required fields are marked *