Solution: Using ProxyPass from http to https in apache2 causes AH02032 SNI error

I got this error message on the when forwarding an URL from an extrernal HTTP server to an internal HTTPS server:

AH02032: Hostname provided via SNI and hostname provided via HTTP are different

The problem turned out to be that the internal server was trusting the external one’s X-Forwarded- headers, a feature which was crucial to other parts of the setup and couldn’t be disabled. The solution was to disable sending of X-Forwarded- for this particular proxy URL by disabling ProxyAddHeaders.

The “fixed” config, as follows:

SSLProxyEngine on
SSLProxyCheckPeerCN on
SSLProxyCheckPeerExpire on
ProxyPass /nice/page.php min=1 max=5 retry=10
ProxyPassReverse /nice/page.php
ProxyAddHeaders off
ProxyPreserveHost off

Hope this helps someone 🙂

1 Comment

Leave a Reply

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