0
votes

I have a strange task and I haven't worked with Tomcat yet, so don't beat me strongly.

I have an application written on node.js that generates random string every couple of minutes. After that, it should create rewrite rule for Apache Tomcat using the random string as a condition. The rule should make reverse proxy to the node.js app.

for Apache the rule would be like:

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /

RewriteRule ^(random_string/?(.*)?)$ http://localhost:8000/$1 [L,P]
</IfModule>

As I know there are two ways for making this:

  • Tomcat 8 has own Valve for rewriting
  • Tuckey URL filter

Help me please with this issues:

  • What popularity of Tuckey and valves.rewrite.RewriteValve
  • How to make config reload for Tomcat
  • How to make proxy reverse using valves.rewrite.RewriteValve

UPD: Tuckey Url filter can reload class by param confReloadCheckInterval

1

1 Answers

1
votes

How to make config reload for Tomcat

I do not believe it is possible to reload the main configuration file like other services such as Apache HTTPD. This is taken from the docs:

...since the main conf/server.xml file cannot be reloaded without restarting Tomcat.

However, context can be reloaded so there is hope as the documents on RewriteValve indicate the following:

... It can also be in the context.xml of a webapp.

Hope that helps.