Magento News

 

Magento installation with reverse proxy

Hi

I tried to search the forums for a solution but I keep getting \\\\\\\\\\\\\\\”search disabled\\\\\\\\\\\\\\\” error, so if this has been answered before please let me know the thread.

I have 2 webservers behind a router. Both running Apache 2.2

Router has the external IP, both webservers have internal IP.

Router forwards all HTTP requests to Server 1 which serves different domains using virtual hosts configuration.

Server 2 is a new server for a domain( newexample.com) which runs Magento.

Server 1 has a reverse proxy setting to forward any requests for (newexample.com)

Reverse proxy is working and configured correctly.

Magento has been installed with base url http://www.newexample.com and not with internal IP address on Server 2.

During installation magento was installed with out the reverse proxy setting, i.e by accessing the server 2 directly using a browser on server 2 by modifying /etc/hosts with an added entry for http://www.newexample.com to point to the internal IP.

Magento installation was successful and all features can be accessed using http://www.newexample.com domain using a browser on the local machine.

After installation the etc/hosts file was remodified to remove http://www.newexample.com

===

Problem

When some one accesses http://www.newexample.com from outside world, their request gets to the router, which forwards by NAT to server 1.

Server 1 using reverse proxy sends it to Server 2.

This works and has been tested using static and php files.

But when the request is for magento, magento keeps forwarding it back to Server 1 and resulting in an infinite loop.

To resolve this I changed the base URL in the database to the local ip address.

Now everything works, i.e there is no infinite redirect.

Magento page gets loaded on the browser.

The problem now is all the links in the browser have the internal ip address, so users cannot go beyond the first landed page.

==

Can some one throw me some light on how do we stop Magento from doing a DNS lookup and forwarding the request back to the router.

Can any one point me in the correct direction of how to install this with reverse proxy i.e Magento specific not for Apache. As our reverse proxy has been configured correctly and works for everything else apart from Magento.

Magento installation with reverse proxy

Possibly Related Posts:


 

Leave a Reply