You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've been using this initial rule for a long time and it's worked great. I am attempting to upgrade my Tomcat to use http/2. When I do so, it causes the hostname used to match to be blank, as shown below. Any ideas on how to fix this? I am using 4.0.3 as I see that is the preferred version for Tomcat 9. Thanks so much for any help!
Update: I was able to move this logic to a Tomcat filter, so I don't really need a fix (and I can't run new versions anyway), but FYI in case you want to look at it or someone else runs into it.
when going to localhost in my browser, I get incorrectly redirected as localhost is not supposed to redirect. Here is the debug log. Note that it correctly shows localhost on the first line, but then attempts to match the rules against "".
org.tuckey.web.filters.urlrewrite.utils.ServerNameMatcher DEBUG: looking for hostname match on current server name localhost
org.tuckey.web.filters.urlrewrite.UrlRewriteFilter DEBUG: checking for status path on /
org.tuckey.web.filters.urlrewrite.UrlRewriter DEBUG: processing request for /
org.tuckey.web.filters.urlrewrite.RuleBase DEBUG: redirect (rule 0) run called with /
org.tuckey.web.filters.urlrewrite.RuleBase DEBUG: matched "from"
org.tuckey.web.filters.urlrewrite.Condition DEBUG: evaluating "" against ^www.myhost.com
org.tuckey.web.filters.urlrewrite.Condition DEBUG: not equal operator in use
org.tuckey.web.filters.urlrewrite.Condition DEBUG: evaluating "" against ^localhost
org.tuckey.web.filters.urlrewrite.Condition DEBUG: not equal operator in use
org.tuckey.web.filters.urlrewrite.RuleBase DEBUG: conditions match
org.tuckey.web.filters.urlrewrite.substitution.MatcherReplacer DEBUG: found 1
org.tuckey.web.filters.urlrewrite.substitution.MatcherReplacer DEBUG: replaced sb is https://www.myhost.com/
org.tuckey.web.filters.urlrewrite.RuleExecutionOutput DEBUG: needs to be permanentely redirected to https://www.myhost.com/
org.tuckey.web.filters.urlrewrite.UrlRewriter DEBUG: rule is last
If I change the tomcat config back to not use http/2, it works as usual:
org.tuckey.web.filters.urlrewrite.utils.ServerNameMatcher DEBUG: looking for hostname match on current server name localhost
org.tuckey.web.filters.urlrewrite.UrlRewriteFilter DEBUG: checking for status path on /
org.tuckey.web.filters.urlrewrite.UrlRewriter DEBUG: processing request for /
org.tuckey.web.filters.urlrewrite.RuleBase DEBUG: redirect (rule 0) run called with /
org.tuckey.web.filters.urlrewrite.RuleBase DEBUG: matched "from"
org.tuckey.web.filters.urlrewrite.Condition DEBUG: evaluating "localhost" against ^www.myhost.com
org.tuckey.web.filters.urlrewrite.Condition DEBUG: not equal operator in use
org.tuckey.web.filters.urlrewrite.Condition DEBUG: evaluating "localhost" against ^localhost
org.tuckey.web.filters.urlrewrite.Condition DEBUG: not equal operator in use
org.tuckey.web.filters.urlrewrite.RuleBase DEBUG: conditions do not match
org.tuckey.web.filters.urlrewrite.RuleBase DEBUG: Rule 1 run called with /
org.tuckey.web.filters.urlrewrite.RuleBase DEBUG: Rule 2 run called with /
org.tuckey.web.filters.urlrewrite.RuleBase DEBUG: matched "from"
org.tuckey.web.filters.urlrewrite.RuleBase DEBUG: 'to' is '-', no substitution, passing through URL
org.tuckey.web.filters.urlrewrite.RuleExecutionOutput DEBUG: needs no substitution
org.tuckey.web.filters.urlrewrite.UrlRewriter DEBUG: rule is last
The text was updated successfully, but these errors were encountered:
I've been using this initial rule for a long time and it's worked great. I am attempting to upgrade my Tomcat to use http/2. When I do so, it causes the hostname used to match to be blank, as shown below. Any ideas on how to fix this? I am using 4.0.3 as I see that is the preferred version for Tomcat 9. Thanks so much for any help!
Update: I was able to move this logic to a Tomcat filter, so I don't really need a fix (and I can't run new versions anyway), but FYI in case you want to look at it or someone else runs into it.
when going to localhost in my browser, I get incorrectly redirected as localhost is not supposed to redirect. Here is the debug log. Note that it correctly shows localhost on the first line, but then attempts to match the rules against "".
org.tuckey.web.filters.urlrewrite.utils.ServerNameMatcher DEBUG: looking for hostname match on current server name localhost
org.tuckey.web.filters.urlrewrite.UrlRewriteFilter DEBUG: checking for status path on /
org.tuckey.web.filters.urlrewrite.UrlRewriter DEBUG: processing request for /
org.tuckey.web.filters.urlrewrite.RuleBase DEBUG: redirect (rule 0) run called with /
org.tuckey.web.filters.urlrewrite.RuleBase DEBUG: matched "from"
org.tuckey.web.filters.urlrewrite.Condition DEBUG: evaluating "" against ^www.myhost.com
org.tuckey.web.filters.urlrewrite.Condition DEBUG: not equal operator in use
org.tuckey.web.filters.urlrewrite.Condition DEBUG: evaluating "" against ^localhost
org.tuckey.web.filters.urlrewrite.Condition DEBUG: not equal operator in use
org.tuckey.web.filters.urlrewrite.RuleBase DEBUG: conditions match
org.tuckey.web.filters.urlrewrite.substitution.MatcherReplacer DEBUG: found 1
org.tuckey.web.filters.urlrewrite.substitution.MatcherReplacer DEBUG: replaced sb is https://www.myhost.com/
org.tuckey.web.filters.urlrewrite.RuleExecutionOutput DEBUG: needs to be permanentely redirected to https://www.myhost.com/
org.tuckey.web.filters.urlrewrite.UrlRewriter DEBUG: rule is last
If I change the tomcat config back to not use http/2, it works as usual:
org.tuckey.web.filters.urlrewrite.utils.ServerNameMatcher DEBUG: looking for hostname match on current server name localhost
org.tuckey.web.filters.urlrewrite.UrlRewriteFilter DEBUG: checking for status path on /
org.tuckey.web.filters.urlrewrite.UrlRewriter DEBUG: processing request for /
org.tuckey.web.filters.urlrewrite.RuleBase DEBUG: redirect (rule 0) run called with /
org.tuckey.web.filters.urlrewrite.RuleBase DEBUG: matched "from"
org.tuckey.web.filters.urlrewrite.Condition DEBUG: evaluating "localhost" against ^www.myhost.com
org.tuckey.web.filters.urlrewrite.Condition DEBUG: not equal operator in use
org.tuckey.web.filters.urlrewrite.Condition DEBUG: evaluating "localhost" against ^localhost
org.tuckey.web.filters.urlrewrite.Condition DEBUG: not equal operator in use
org.tuckey.web.filters.urlrewrite.RuleBase DEBUG: conditions do not match
org.tuckey.web.filters.urlrewrite.RuleBase DEBUG: Rule 1 run called with /
org.tuckey.web.filters.urlrewrite.RuleBase DEBUG: Rule 2 run called with /
org.tuckey.web.filters.urlrewrite.RuleBase DEBUG: matched "from"
org.tuckey.web.filters.urlrewrite.RuleBase DEBUG: 'to' is '-', no substitution, passing through URL
org.tuckey.web.filters.urlrewrite.RuleExecutionOutput DEBUG: needs no substitution
org.tuckey.web.filters.urlrewrite.UrlRewriter DEBUG: rule is last
The text was updated successfully, but these errors were encountered: