<div class="example"><h3>Single application instance</h3><pre class="prettyprint lang-config">ProxyPass /myapp/ fcgi://localhost:4000/</pre>
</div>
- <p>This application should be able to handle multiple concurrent
- connections. <code class="module"><a href="../mod/mod_proxy.html">mod_proxy</a></code> enables connection reuse by
- default, so after a request has been completed the connection will be
- held open by that httpd child process and won't be reused until that
- httpd process routes another request to the application. If the
- FastCGI application is unable to handle enough concurrent connections
- from httpd, requests can block waiting for the application to close
- an existing connection. One way to resolve this is to disable connection
- reuse on the <code class="directive">ProxyPass</code> directive, as shown in
- the following example:</p>
+ <p> <code class="module"><a href="../mod/mod_proxy_fcgi.html">mod_proxy_fcgi</a></code> disables connection reuse by
+ default, so after a request has been completed the connection will NOT be
+ held open by that httpd child process and won't be reused. If the
+ FastCGI application is able to handle concurrent connections
+ from httpd, you can opt-in to connection reuse as shown in the following
+ example:</p>
- <div class="example"><h3>Single application instance, no connection reuse</h3><pre class="prettyprint lang-config">ProxyPass /myapp/ fcgi://localhost:4000/ disablereuse=on</pre>
+ <div class="example"><h3>Single application instance, connection reuse</h3><pre class="prettyprint lang-config">ProxyPass /myapp/ fcgi://localhost:4000/ disablereuse=off</pre>
</div>
<p> The following example passes the request URI as a filesystem
path for the PHP-FPM daemon to run. The request URL is implicitly added
to the 2nd parameter. The hostname and port following fcgi:// are where
- PHP-FPM is listening.</p>
- <div class="example"><h3>PHP-FPM</h3><pre class="prettyprint lang-config">ProxyPassMatch ^/myapp/.*\.php(/.*)?$ fcgi://localhost:9000/var/www/</pre>
+ PHP-FPM is listening. Connection pooling is enabled.</p>
+ <div class="example"><h3>PHP-FPM</h3><pre class="prettyprint lang-config">ProxyPassMatch ^/myapp/.*\.php(/.*)?$ fcgi://localhost:9000/var/www/ disablereuse=off</pre>
</div>
<p> The following example passes the request URI as a filesystem
path for the PHP-FPM daemon to run. In this case, PHP-FPM is listening on
a unix domain socket (UDS). Requires 2.4.9 or later. With this syntax,
the hostname and optional port following fcgi:// are ignored.</p>
- <div class="example"><h3>PHP-FPM with UDS</h3><pre class="prettyprint lang-config">ProxyPassMatch ^/(.*\.php(/.*)?)$ "unix:/var/run/php5-fpm.sock|fcgi://localhost/var/www/"</pre>
+ <div class="example"><h3>PHP-FPM with UDS</h3><pre class="prettyprint lang-config"> # UDS does not currently support connection reuse
+ ProxyPassMatch ^/(.*\.php(/.*)?)$ "unix:/var/run/php5-fpm.sock|fcgi://localhost/var/www/"</pre>
</div>
<p>The balanced gateway needs <code class="module"><a href="../mod/mod_proxy_balancer.html">mod_proxy_balancer</a></code> and