Hello, In http://httpd.apache.org/docs/2.4/mod/mod_proxy.html#proxypassmatch it is said: Context: server config, virtual host, directory However, it's not allowed to be used in directory, the following error is thrown: ProxyPassMatch cannot occur within <Directory> section Is it a bug in documentation or Apache?
Could this bug please be fixed? Thank you. :)
Hello, we have really big problem: we are using ProxyPass and <IF> - statements and since 2.4.4 that no longer works! Error message: ProxyPass cannot occur within <IF> section I think, my problem has the same reason, so, please - fix this bug as soon as possible! Thanks in advance! P.S.: In 2.4.3 always worked fine ...
(In reply to comment #2) > Hello, > > we have really big problem: we are using ProxyPass and <IF> - statements and > since 2.4.4 that no longer works! Error message: > ProxyPass cannot occur within <IF> section > > I think, my problem has the same reason, so, please - fix this bug as soon > as possible! > > Thanks in advance! > > P.S.: In 2.4.3 always worked fine ... If your problem only started in 2.4.4, I think you need a separate bug. I think this bug has been this way for the life of 2.4.x
Guys, it's critical to use with php-fpm, it's not safe now, it's very important!
any news? we have a lot of trouble with this issue
(In reply to comment #5) > any news? we have a lot of trouble with this issue Can you elaborate on what your configuration is and when it broke?
Password protected directories, index pages (if it should load .html firstly, not the .php file) and some other things do not work correctly when ProxyPassMatch is outside the Directory block. For example, the following works: ProxyPassMatch ^/(.*\.php(/.*)?)$ fcgi://127.0.0.1:9000/var/www/html/mysite.com/public_htm/$1 <Directory /var/www/html/mysite.com/public_html> Options +Indexes +FollowSymLinks +Includes +MultiViews </Directory> And the following does not work: <Directory /var/www/html/mysite.com/public_html> Options +Indexes +FollowSymLinks +Includes +MultiViews ProxyPassMatch ^/(.*\.php(/.*)?)$ fcgi://127.0.0.1:9000/var/www/html/mysite.com/public_htm/$1 </Directory> However, according to documentation (http://httpd.apache.org/docs/2.4/mod/mod_proxy.html#proxypassmatch), it should work there, however, it throws errors: ProxyPassMatch cannot occur within <Directory> section Another way (workaround) is to use rewrite rules, however, we use https://issues.apache.org/bugzilla/show_bug.cgi?id=54101 and for some reason RewriteRule acts differently in Directory block than outside it. If we provide: RewriteRule ^/(.*\.php(/.*)?)$ fcgi://socket=\%2fusr\%2flocal\%2fsockets\%2fmysite.sock|DOCROOT|/$1 [P,E=HTTP_AUTHORIZATION:%{HTTP:Authorization},L] Placed outside "Directory" it works correctly, path to the socket is /usr/local/sockets/mysite.sock If placed in "Directory" block it does not work, because it thinks that the socket is placed here (that's the full path it converts to and it's incorrect, of course): fusrflocalfsocketsfmysite.sock So, it's another bug of wrong RewriteRule behaviour.
> However, according to documentation > (http://httpd.apache.org/docs/2.4/mod/mod_proxy.html#proxypassmatch), it > should work there, however, it throws errors: > ProxyPassMatch cannot occur within <Directory> section > When did this last work and do what you expected (accepted in directory context and successfully proxied)? It's probably blocked from that context because it didn't work in that context when it was accepted.
It did not work when we first tried it (about 3months ago), so I think "directory" should be removed from http://httpd.apache.org/docs/2.4/mod/mod_proxy.html#proxypassmatch, or support for it added, because now documentation is misleading. Without it, the only way to run php-fpm with unix sockets (https://issues.apache.org/bugzilla/show_bug.cgi?id=54101) would be using RewriteRule, but it doesn't work correctly too (in the previous comment it was explained), so, for now the following are true: * It is impossible to run PHP-FPM correctly with apache using unix domain sockets (https://issues.apache.org/bugzilla/show_bug.cgi?id=54101) * It is impossible to run PHP-FPM using port number correctly, unless using RewriteRule in "Directory" block (http://wiki.apache.org/httpd/PHP-FPM does not work, if placed in "Directory" Possible solutions: * Drop https://issues.apache.org/bugzilla/show_bug.cgi?id=54101 from apache trunk or fix the RewriteRule behavior in "Directory" * Remove "directory" from http://httpd.apache.org/docs/2.4/mod/mod_proxy.html#proxypassmatch, or add support for it in apache code
The original report is resolved by making the documentation match the restriction in the code. If anyone is interested in using ProxyPassMatch in <Directory> context, try removing the restriction against coding it that way in the configuration (mod_proxy.c:1390) and report back under what configurations it succeeds to actually proxy * if it works, open a new bug report * If it doesn't work (my suspicon) , open an enhancement ticket in bugzilla
Created attachment 30283 [details] Fixes RewriteRule in Directory context.
*** Bug 54965 has been marked as a duplicate of this bug. ***