You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Jason Brooks <ja...@eroi.com> on 2016/12/14 22:37:07 UTC

[users@httpd] More info about proxypassmatch and fpm mode

Hello,

I am using the following with apache 2.4 with php in fpm mode:

ProxyPassMatch ^/(.*\.php(/.*)?)$ fcgi://127.0.0.1:9000/path/to/your/documentroot/$1
DirectoryIndex /index.php index.php

This works just fine, but I wanted to ask some questions:

1) the “/path/to/your/documentroot” is effectively the path used to find the php script then run it.  but substituting %{DOCUMENT_ROOT} does not work.  Is there a means of making this happen?

2) with multiple vhosts I would need a separate proxypassmatch line for each vhost.  If I do not need to change the php user, is there any need to use a different port number such as fcgi://127.0.0.1:9001, or is it ok to use the same ip/port combo with a different /path/to/your/documentroot?

3) Are there any other parameters passed to the proxy port?


Jason Brooks	Systems Administrator
eROI	Performance is Art.
 
m:	505 nw couch #300	w:	eroi.com <http://eroi.com/>
t:	503.290.3105	f:	503.228.4249


fb:	fb.com/eROI <http://www.facebook.com/eROI>









Re: [users@httpd] More info about proxypassmatch and fpm mode

Posted by Eric Covener <co...@gmail.com>.
On Wed, Dec 14, 2016 at 5:37 PM, Jason Brooks <ja...@eroi.com> wrote:

>
> 1) the “/path/to/your/documentroot” is effectively the path used to find
> the php script then run it.  but substituting %{DOCUMENT_ROOT} does not
> work.  Is there a means of making this happen?
>
>
​You could indirectly use what the manual describes as the "sethandler"
method. This allows all the normal directives to map the URL to the
filesystem.
​

> 2) with multiple vhosts I would need a separate proxypassmatch line for
> each vhost.  If I do not need to change the php user, is there any need to
> use a different port number such as fcgi://127.0.0.1:9001, or is it ok to
> use the same ip/port combo with a different /path/to/your/documentroot?
>
>
​Should be OK.​



> 3) Are there any other parameters passed to the proxy port?
>

​There are a number of variables calculated from the current request, such
as PATH_INFO, or variables for the request​ headers.   But nothing you
can/need to specify in the conf.



-- 
Eric Covener
covener@gmail.com