Apache Reverse Proxy won't PreserveHost

Hey,

I’m having some troubles with my Apache Reverse Proxy as soon as i activate Cloudfare Proxy.

My Setup is currently: Cloudfare → proxy01(public-ip) → web01(intern-ip).

The Web01 is listening on a vhost that requires a specific Server name . So if anything is going right you connect via Cloudfare to the proxy01 and he preserves the host, so web01 knows exactly what side to show. This Conifguration works completly fine and wihtout Problems till I enable the Cloudfare proxy, after enabling it web01 will only show the default directory(e.g /var/www/html)

Am I’m missing something?

RequestHeader unset Accept-Encoding
    RequestHeader set Host "example.com"
    RequestHeader add X-Forwarded-Ssl on
    RequestHeader set X-Forwarded-Proto "https"
    ProxyPass / http://10.50.100.18/
    ProxyPassReverse / http://10.50.100.18/

Proxy01 is running on port 80 and port 443 with cloudfare strict SSL and a redirect to https if you try to use http.
Web01 is only using port 80

Well, I feel a little bit stupid. I tought I had runnign strict ssl. But I wasn’t. I was running flexibel, with that sending a webrequest to proxy01:80 where no reverse Proxy is running…
As soon as I enabled Strict SSL anything started working. :slight_smile:

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.