ipv6 proxy forward result in bad request

user1316830 asked:

I’ve configured the apache httpd server to act as a proxy forwarder. Following is my conf file details

Listen 0.0.0.0:9999
Listen [::]:9999
<VirtualHost *:9999>

SSLEngine off
SSLProxyEngine On
SSLCertificateFile /etc/httpd/ssl/ca.crt
SSLCertificateKeyFile /etc/httpd/ssl/ca.key

ProxyRequests Off
ProxyPreserveHost On

RewriteEngine on
RewriteRule ^/rest/v1/ https://%{HTTP_HOST}/rest/v1/
</VirtualHost>

I’m using the curl client

for IPv4:

curl http://192.168.56.11/rest/v1/ –proxy 0.0.0.0:9999 -v

It is working fine and I’m getting the proper result

for IPv6:

curl -6 http://fe80::2:0:9:1%eth1/rest/v1/EnclosureManagers/1/ –proxy [::]:9999 -v

With ipv6 the call is failing and I’m getting response code as “400”. Following error message is seen in error_log for this ipv6 request

[error] [client ::1] request failed: error reading the headers

Actually the target server is Jetty Server but I’m seeing the value as ” Server: Apache/2.2.15 (CentOS)” on failure cases. Also there is no log for call reaching the destination. It is actually failing in the proxy.

My answer:


Your VirtualHost is only set up to process IPv4 connections.

<VirtualHost *:9999>

You need to set it up to process both IPv4 and IPv6 connections.

<VirtualHost *:9999 [::]:9999>

View the full question and answer on Server Fault.

Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.