.htaccess doesn't target .cfm requests proxied to Tomcat

Hi community,

I’m new to Lucee and could do with a little help.

Lucee (Oct 29, 2020)
Ubuntu 20 with VirtualMin
Amazon EC2 instance

I see that .cfm requests are offloaded to Tomcat on port 8888 by Apache’s apache2.conf file by the module ‘mod_proxy’.

Where can I write .htaccess directives that target the proxied requests?

Directives that are in the .htaccess webroot (e.g. /home/domain.com/public_html/.htaccess only work for non-proxied requests (e.g. stuff that stays within the main Apache – PHP and HTML requests).

Requests involving .cfml/.cfm don’t see to be targeted by directives in this main .htaccess.

I’ve found an .htaccess file in /home/domain.com/public_html/WEB-INF/.htaccess and WEB-INF/lucee/.htaccess but those doesn’t seem to effect the proxied requests either!

I see there are around 3 other similar topics on the forum but none of them have shed conclusive light on this and I’ve tried all combinations of directives from code fragments around but haven’t had luck so far.

Hoping someone can shed light.

So it seems like Tomcat on port 8888 is running its own web requests engine, but how can I give it .htaccess rules?

Thanks in advance.

For those who stumble across this in the future. It seems like directives in the Apache configuration file httpd.conf are effective in the mod_proxied (Lucee) requests, but those in the .htaccess aren’t!

For example, this code block:

<Location /lucee>
    Require ip

Is not effective in .htaccess but is effective httpd.conf (/etc/apache2/apache2.conf).

Moreover, with ErrorDocument directives… like this:

ErrorDocument 403 "Get out of here, you asshole!"

They are not effective in .htaccess or httpd.conf configuration structures without an additional directive (in httpd.conf):

<IfModule mod_proxy.c>
ProxyErrorOverride On

This tells Apache to honour its own Error handling philosophy and will thus respect the ErrorDocument rules. [Source]

The above applies to this config:
Lucee (Oct 29, 2020)
Ubuntu 20 with VirtualMin
Amazon EC2 instance