Proxy spec for Apache2.4 and php7-fpm

Skip to first unread message

Lindsay Haisley

Mar 1, 2018, 9:17:01 PM3/1/18
to highload-php-en
I'm using the recipe for Proxy via handler at the PHP-FPM - Httpd Wiki, the code for which is:

  • # Defining a worker will improve performance

    # And in this case, re-use the worker (dependent on support from the fcgi application)

    # If you have enough idle workers, this would only improve the performance marginally

    <Proxy "fcgi://localhost:9000/" enablereuse=on max=10>


    <FilesMatch "\.php$">

        <If "-f %{REQUEST_FILENAME}">

            # Pick one of the following approaches

            # Use the standard TCP socket

            #SetHandler "proxy:fcgi://localhost/:9000"

            # If your version of httpd is 2.4.9 or newer (or has the back-ported feature), you can use the unix domain socket

            #SetHandler "proxy:unix:/path/to/app.sock|fcgi://localhost/"



I'm using unix sockets, so the references to TCP/IP ports is spurious, and the code, which I've modified to support my requirements here, works well. My question regards the <Proxy> directive to tune PHP-FPM. Is it sufficient to simply drop the port number so that the line becomes:

<Proxy "fcgi://localhost/" enablereuse=on max=10>

In the appropriate SetHandler invocation the target for the "fcgi://" scheme is pretty much a no nevermind and makes no difference, as I've discovered from experimentation and found mentioned in several places. What should be used for "fcgi://" in the <Proxy> directive? Or does it matter, as it doesn't for SetHandler?

Lindsay Haisley

Mar 2, 2018, 12:26:24 PM3/2/18
to highload-php-en
It seems it doesn't matter and that as long as the fgdi: spec is lexically legal, it's ignored. I'm using "fcgi://*, in both the Proxy and SetHandler specs and everything is working fine.

Reply all
Reply to author
0 new messages