我使用带有SSL证书的EC2 ELB背后的URLRewriteFilter运行Tomcat,ELB将流量从端口80和443重定向到后端实例中的端口8080。 URLRewriteFilter具有以下规则:
<rule>
<condition type="scheme" operator="notequal">https</condition>
<condition name="host" operator="equal">ELB-DNS</condition>
<from>^/(.*)</from>
<to type="permanent-redirect">https://ELB-DNS/$1</to>
</rule>
但是当我尝试击中它时,我得到了这个:
Error 310 (net::ERR_TOO_MANY_REDIRECTS): There were too many redirects.
答案 0 :(得分:0)
尝试设置port
条件:
<rule>
<condition type="scheme" operator="notequal">https</condition>
<condition name="host" operator="equal">ELB-DNS</condition>
<condition name="port" operator="equal">(80|443)</condition>
<from>^/(.*)</from>
<to type="permanent-redirect">https://ELB-DNS:8080/$1</to>
</rule>