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