baoutch
baoutch

Reputation: 1704

Magento frontend redirect error while using reverse proxy

We've been struggling with a problem involving a Magento website and a reverse proxy.

Server A is used as a reverse proxy (apache) and redirects incoming subdomain.domain.com/appname to local-ip/appname hosted on server B (apache as well).

What is really weird is that everything works fine on backend. We can login, modify stuff, everything perfectly normal there.

But on frontend nothing works and there is an infinite redirection.

However setting up Magento with local-ip/appname as the base url, and accessing it through subdomain.domain.com/appname (not with local-ip/appname) works fine if accessed from local network.

As soon as Magento uses adress subdomain.domain.com/appname as base url, frontend gives an infinite redirection error.

If anyone has any input on that we would really appreciate.

Thanks!

Upvotes: 0

Views: 919

Answers (1)

baoutch
baoutch

Reputation: 1704

For the record, reverse proxy needed the directive

ProxyPreserveHost On

As it is set to Off by default there was an infinite redirection as Magento was trying to access the external address which was transformed as local ip by reverse proxy ans so on. With ProxyPreserveHost On reverse proxy transmits original url to the website behind him. As a consequence Magento can be set up with external address as base url.

Upvotes: 1

Related Questions