Bug 54887 - htaccess directives not working with mod_proxy_fcgi
Summary: htaccess directives not working with mod_proxy_fcgi
Alias: None
Product: Apache httpd-2
Classification: Unclassified
Component: mod_proxy_fcgi (show other bugs)
Version: 2.5-HEAD
Hardware: PC FreeBSD
: P2 normal (vote)
Target Milestone: ---
Assignee: Apache HTTPD Bugs Mailing List
Depends on:
Reported: 2013-04-24 14:54 UTC by admin
Modified: 2014-01-29 22:15 UTC (History)
0 users


Note You need to log in before you can comment on or make changes to this bug.
Description admin 2013-04-24 14:54:16 UTC
While using mod_proxy_fcgi like:

RewriteRule ^/(.*\.(php|php3|php4|php5|phps|phtml|inc)(/.*)?)$ fcgi://$1 [P]

directives in .htaccess like
-deny from xxx
<Files file.php>
deny fromxxx

etc. would not work - file will be processed by backend and returned to browser without further .htaccess check.

We should be able to run "auth phase 'check access (with Satisfy All)'" with mod_proxy_fcgi like with mod_fcgid.
Comment 1 Eric Covener 2013-04-24 15:04:07 UTC
What Directories would be searched for htaccess in this case if the URL isn't mapped to the filesystem?
Comment 2 admin 2013-04-24 15:05:48 UTC
I belive /DOCROOT/ ?
Is it at all possible to proceed with other (htaccess) rules after backend returned result?
Comment 3 admin 2013-04-24 20:24:15 UTC
Maybe it's possible to run VH Rewrite to proxy after all the .htaccess rewrites are done?
Comment 4 phpfpm1 2014-01-10 15:22:53 UTC
Have you tried putting RewriteRule to <Directory> context?
Comment 5 Eric Covener 2014-01-10 15:39:29 UTC
Proxied content doesn't match filesystem containers <files> or <Directory>, this is working as designed.

Workaround in comment #4 might help, as it causes files to be mapped to the filesystem first then proxied in a later phase on a new internal redirect.
Comment 6 admin 2014-01-29 22:11:03 UTC
Unfortunatelly workaround from comment #4 is not working. There is no internal redirect back to proxy (wrapped in <Directory>) from .htaccess.
Comment 7 Eric Covener 2014-01-29 22:15:59 UTC
This is invalid as a bug, the configuration does not map anythin to disk. For configuration advice or support, try users@httpd.apache.org or serverfault.  We can only entertain bugs against httpd here.