URLRewriteFilter HTTPS HTTP rule returning net :: ERR_TOO_MANY_REDIRECTS

My Tomcat works with URLRewriteFilter for EC2 ELB with SSL certificates, ELB redirects traffic from ports 80 and 443 to port 8080 in backend instances. URLRewriteFilter has this rule:

<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> 

but when I try to hit him, I got the following:

 Error 310 (net::ERR_TOO_MANY_REDIRECTS): There were too many redirects. 
+2
source share
1 answer

Try setting the port condition:

 <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> 
0
source

Source: https://habr.com/ru/post/969405/


All Articles