I already tested a bit with rewrite bit my and your variant is not
working. If I set your variant the result is:
mod_proxy_fcgi.c(995): [client 172.31.30.115:54624] AH01076: url:
fcgi://127.0.0.1:9005//opt/data/another proxyname: (null) proxyport: 0,
referer: http://nextcloud.jki.intern/
mod_proxy_fcgi.c(1002): [client 172.31.30.115:54624] AH01078: serving
URL fcgi://127.0.0.1:9005//opt/data/another, referer:
http://nextcloud.jki.intern/ (Even the "/path" from "/another/path" is truncated :O )
mod_rewrite.c(482): [client 172.31.30.115:54624] 172.31.30.115 - - [...]
init rewrite engine with requested uri /index.php, referer:
http://nextcloud.jki.intern/
mod_rewrite.c(482): [client 172.31.30.115:54624] 172.31.30.115 - - [...]
applying pattern '\\.php$' to uri '/index.php', referer:
http://nextcloud.jki.intern/
mod_rewrite.c(482): [client 172.31.30.115:54624] 172.31.30.115 - - [...]
rewrite '/index.php' -> '/another/path/.php', referer:
http://nextcloud.jki.intern/
mod_rewrite.c(482): [client 172.31.30.115:54624] 172.31.30.115 - - [...]
remember /another/path/.php to have Content-handler
'proxy:fcgi://127.0.0.1:9005/', referer: http://nextcloud.jki.intern/
mod_rewrite.c(482): [client 172.31.30.115:54624] 172.31.30.115 - - [...]
local path result: /another/path/.php, referer:
http://nextcloud.jki.intern/
mod_rewrite.c(482): [client 172.31.30.115:54624] 172.31.30.115 - - [...]
prefixed with document_root to /opt/data/another/path/.php, referer:
http://nextcloud.jki.intern/
mod_rewrite.c(482): [client 172.31.30.115:54624] 172.31.30.115 - - [...]
go-ahead with /opt/data/another/path/.php [OK], referer:
http://nextcloud.jki.intern/

mod_rewrite.c(482): [client 172.31.30.115:54624] 172.31.30.115 - - [...]
[perdir /opt/data/] add path info postfix: /opt/data/another ->
/opt/data/another/path/.php, referer: http://nextcloud.jki.intern/
mod_rewrite.c(482): [client 172.31.30.115:54624] 172.31.30.115 - - [...]
[perdir /opt/data/] strip per-dir prefix: /opt/data/another/path/.php ->
another/path/.php, referer: http://nextcloud.jki.intern/
mod_rewrite.c(482): [client 172.31.30.115:54624] 172.31.30.115 - - [...]
[perdir /opt/data/] applying pattern '^$' to uri 'another/path/.php',
referer: http://nextcloud.jki.intern/
mod_rewrite.c(482): [client 172.31.30.115:54624] 172.31.30.115 - - [...]
[perdir /opt/data/] add path info postfix: /opt/data/another ->
/opt/data/another/path/.php, referer: http://nextcloud.jki.intern/
mod_rewrite.c(482): [client 172.31.30.115:54624] 172.31.30.115 - - [...]
[perdir /opt/data/] strip per-dir prefix: /opt/data/another/path/.php ->
another/path/.php, referer: http://nextcloud.jki.intern/ Regards,
Am 2020-10-14 16:19, schrieb Eric Covener:

On Wed, Oct 14, 2020 at 9:47 AM Robin Kluth <kont...@kluthr.de> wrote:
Hi,

I have a short question to the Apache pro's ;)

I setup a vHost with Document pointing to /opt/data

A PHP-FPM instance is set up inside a docker container.

<FilesMatch "\.php$">
SetHandler "proxy:fcgi://127.0.0.1:9005/"
</FilesMatch>

So, Apache does the following now:

I access the web page and Apache serves every non PHP file from /opt/data - In the 
meantime any .php request would be sent to the proxy:fcgi.. Apache always expands the 
proxy request to "proxy:fcgi://127.0.0.1:9005/opt/data".

How can I stop Apache doing this? When I specify an own path like:

<FilesMatch "\.php$">
SetHandler "proxy:fcgi://127.0.0.1:9005/another/path"
</FilesMatch>

The new request becomes "proxy:fcgi://127.0.0.1:9005/another/path/opt/data":

mod_proxy_fcgi.c(995): [client 172.31.30.115:51615] AH01076: url: 
fcgi://127.0.0.1:9005/another/path/opt/data/index.php proxyname: (null) 
proxyport: 0
mod_proxy_fcgi.c(1002): [client 172.31.30.115:51615] AH01078: serving URL 
fcgi://127.0.0.1:9005/another/path/opt/data/index.php

Is there any option to prevent Apache doing this? ProxyPass(Match) does it but 
has problems here with any whitespaces, so I wanted to use SetHandler.

The high level issue/cause here is that the core of the server will
map URL's to Filenames and the tracked filename is what proxy_fcgi
knows to request.

How about something in this neighborhood (in vhost/global scope) which
sets r->filename and the handler together w/ rewrite:

RewriteEngine ON
RewriteRule \.php$ /another/path/$0 [H=proxy:fcgi://127.0.0.1:9005/]

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@httpd.apache.org
For additional commands, e-mail: users-h...@httpd.apache.org

Reply via email to