我configuration了Apache的httpd服务器来充当代理转发器。 以下是我的conf文件的详细信息
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>
我正在使用curl客户端
对于IPv4:
curl http://192.168.56.11/rest/v1/ –proxy 0.0.0.0:9999 -v
它工作正常,我得到了正确的结果
对于IPv6:
curl -6 http:// fe80 :: 2:0:9:1%eth1 / rest / v1 / –proxy [::]:9999 -v
与ipv6呼叫失败,我得到的响应代码为“400”。 以下错误消息在error_log中显示为此ipv6请求
[错误] [client :: 1]请求失败:读取头文件时出错
其实目标服务器是Jetty服务器,但在失败情况下,我看到“Server:Apache / 2.2.15(CentOS)”的价值。 也没有到达目的地的电话logging。 它实际上在代理失败。
您的VirtualHost仅设置为处理IPv4连接。
<VirtualHost *:9999>
您需要将其设置为处理IPv4和IPv6连接。
<VirtualHost *:9999 [::]:9999>