0

I have been following this tutorial to set up a reverse proxy. I have moved some sites to a new server, and changing the DNS for a lot of alias domains is going to take a while. To minimize issues, I want to redirect all traffic to the new location with a reverse proxy.

It does work, but I get a default page on the new server while configuration is exactly the same and editing my hosts file does work.

This is the config that I'm using:

 <VirtualHost *:80> ServerName domain.com ServerAlias *.domain.com ServerAlias domain2.com *.domain2.com ErrorLog ${APACHE_LOG_DIR}/proxy-error.log CustomLog ${APACHE_LOG_DIR}/proxy-access.log combined ProxyRequests Off ProxyPass / http://x.x.x.x/ ProxyPassReverse / http://x.x.x.x/ </VirtualHost> 

Does it has something to do with the fact that I use http://ip_adress/ for the ProxyPass condition?

2

1 Answer 1

1

This setup requires that the original Host: header be passed onward from your proxy to the new origin server.

This is done with ProxyPreserveHost:

 ProxyPreserveHost On 

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.