Apache ReverseProxy Netscaler网关中止请求,因为集合Cookie中的字符无效

Apache ReverseProxy Netscaler网关中止请求,因为集合Cookie中的字符无效,apache,mod-proxy,netscaler,Apache,Mod Proxy,Netscaler,我有一个apache,它可以作为Netscale网关的反向代理。有时可以,但在许多情况下,请求以500结尾。日志始终提供相同的错误类型: [Mon Aug 20 12:51:24.541905 2018] [http:error] [pid 4919:tid 140600024221440] [client 192.168.22.194:40187] AH02430: Response header 'Set-Cookie' value of 'NSC_TASS=\x0fi\xd4a\xbd\x

我有一个apache,它可以作为Netscale网关的反向代理。有时可以,但在许多情况下,请求以500结尾。日志始终提供相同的错误类型:

[Mon Aug 20 12:51:24.541905 2018] [http:error] [pid 4919:tid 140600024221440] [client 192.168.22.194:40187] AH02430: Response header 'Set-Cookie' value of 'NSC_TASS=\x0fi\xd4a\xbd\x8e\xcf\xdek\x18\xcd:\x01\xc6d\xf1\xe6;HttpOnly;Path=/;Secure' contains invalid characters, aborting request
[Mon Aug 20 13:03:09.550947 2018] [http:error] [pid 5023:tid 140354590320384] [client 192.168.22.194:24541] AH02430: Response header 'Set-Cookie' value of 'NSC_TASS=le8M1TpPxu5GG1h8nEom8vsA\xe3\x06\x87\x8fnId=&janusWebEvent=PDClass.getJanusServerPage_webEvent_nextPhaseGC2%2C114078_pid_pdPreview_imgPath_res133136%2Fimg%2F_cid_10_clName_ADV_oidHi_10_oidLow_114073;HttpOnly;Path=/;Secure' contains invalid characters, aborting request
[Mon Aug 20 13:09:15.239058 2018] [http:error] [pid 5330:tid 140134346917632] [client 192.168.22.194:40606] AH02430: Response header 'Set-Cookie' value of 'NSC_TASS=\x95\x15\xa91e\xf8\xc8\x96\xdfI\x02\x89\xf4y\x05\xf2&;HttpOnly;Path=/;Secure' contains invalid characters, aborting request
我认为这是cookie值中的反斜杠,因为反斜杠是不允许的。 apache是否可以跳过此验证,或者我是否可以编写规则将cookie值重写为url编码\utf-8。。。价值

我的配置:

<VirtualHost *:80> # a balancer managed the ssl
    ServerName ng.subdomain.domain.tld
    SSLProxyEngine On
    SSLProxyVerify none 
    SSLProxyCheckPeerCN off
    SSLProxyCheckPeerName off
    SSLProxyCheckPeerExpire off
    ProxyRequests Off
    #ProxyPreserveHost On

    ProxyPass / https://ng.domain2.tld/
    ProxyPassReverse / https://ng.domain2.tld/
    #ProxyPass / wss://ng.domain2.tld/
    #ProxyPassReverse / wss://ng.domain2.tld/


    ProxyPassReverseCookieDomain ng.subdomain.domain.tld ng.domain2.tld
</VirtualHost>
#一个平衡器管理ssl
ServerName ng.subdomain.domain.tld
SSLProxyEngine打开
SSLProxyVerify无
SSLProxyCheckPeerCN关闭
SSLProxyCheckPeerName关闭
SSLProxycheckpeer关闭
代理请求关闭
#代理主机
ProxyPass/https://ng.domain2.tld/
ProxyPassReverse/https://ng.domain2.tld/
#ProxyPass/wss://ng.domain2.tld/
#ProxyPassReverse/wss://ng.domain2.tld/
ProxyPassReverseCokieDomain ng.subdomain.domain.tld ng.domain2.tld

也许您可以将HttpProtocolOptions设置为LenientMethods,默认情况下可能设置为Strict。这仅在代理targetr为无效的restuls返回501时才有效


有关更多信息,请参阅。

一个简单的解决方法是让netscaler对其会话cookie进行加密


要按照上述建议加密会话cookie:

设置lb参数-UseCuredPersistenceCookie启用cookiePassphrase

例如:

set lb parameter-useSecuredPersistenceCookie Enabled Cookie Passphrase test

尝试了它(在不同的组合和位置),但没有发现任何差异:(