I have setup an apache2 proxy that maps urls to backend servers. I'm using the dbd module and authenticate against a MySQL database. However, for every new user added to the database, I have to manually add a ProxyPass rule for this user. I thought I could use a prepared SQL statement that will look up the user in the database and then add a regular expression to the ProxyPass command so I won't have to write manually a separate entry.
In other words, I want to achieve something like this:
DBDPrepareSQL "SELECT username FROM users WHERE username = %s" user_map
ProxyPass /$user_map http://localhost:9090
Is this possible? If not, it may be possible with RewriteMap and RewriteRule, so in that case I would appreciate any advice.
Thanks