Search code examples
apachetomcatreverse-proxymod-proxy

Is is possible to have a dynamic configuration for mod_proxy to connect Apache httpd to Tomcat?


I have an Apache httpd and a Tomcat server connected together using mod_proxy.

I need to add both a ProxyPass and ProxyPassReverse to my httpd.conf and vhost.conf for each of my REST-style functions to configure the reverse proxy.

Is there any possibility to configure these dynamically?


Solution

  • You can't really dynamically-configure mod_proxy, nor would you want to do so, because you want the configuration to stay on the disk so you can reload it, survive server restarts, etc.

    What you could do is include a separate file (or whole directory) each of which contains the configuration for a single function. You could have your build process auto-generate the configuration file(s) for all your functions. Just place those files in the right places and reload Apache httpd.