I am migrating URL rewrite functionality from apache mod_rewrite to Tomcat 8's RewriteValve. I have apache web servers running behind load balancer. There are some URLs getting rewritten based on the domain name.
RewriteCond %{SERVER_NAME} ^xyz.com
RewriteRule /pattern$ /substitution [L]
In Apache's mod_rewrite, the SERVER_NAME variable was working fine. However in tomcat 8 the variable is returning the IP address of the machine instead of the server name.