Welcome! Log In Create A New Profile

Advanced

Apache FastCGI reverse proxy module and PHP-FPM...

Posted by Mathieu CARBONNEAUX 
Mathieu CARBONNEAUX
Apache FastCGI reverse proxy module and PHP-FPM...
February 05, 2011 04:02PM
Hi,

Two project have developped apache proxy fastcgi module:
http://httpd.apache.org/docs/trunk/mod/mod_proxy_fcgi.html ==> the
apache fondation one
http://mproxyfcgi.sourceforge.net/ ==> my module

But with this solution the fastcgi server must be abel to server all
file behind us !
and my question is PHP-FPM are abel to server static file and php
script ?

if not ! while be fun to add this, because they can be served simply
with this apache module, like ajp protocole with tomcat !
and with that solution you can separate apache reverse proxy and php
server in two serveur and in two dmz if necessary !

and you can be abel to loadbalance with the apache proxy mecanisme !

in the past i've made modified version (not very optimized) of php-
fastcgi sapi to handle that!

the only thing is to be abel to handle php with php engine, and all
other file as static file.

An optimized version while be abel to handle Last-Modified and/or ETag
http header...
http://www.w3.org/Protocols/rfc2616/rfc2616-sec13.html#sec13.3.1
with that you can use apache in reverse proxy with caching
(mod_cache) !

and you can combine all of that with mod_security!

thank for this good peace of code!
Mathieu
Jérôme Loyet
Re: Apache FastCGI reverse proxy module and PHP-FPM...
February 06, 2011 06:06AM
2011/2/5 Mathieu CARBONNEAUX <info-php-fpm@ch2o.info>:
> Hi,
>
> Two project have developped apache proxy fastcgi module:
> http://httpd.apache.org/docs/trunk/mod/mod_proxy_fcgi.html ==> the
> apache fondation one
> http://mproxyfcgi.sourceforge.net/ ==> my module
>
> But with this solution the fastcgi server must be abel to server all
> file behind us !
> and my question is PHP-FPM are abel to server static file and php
> script ?

the short answer is no

the long answer is:
- if you test requesting FPM with a non PHP script, it will return the
content of the file
- But the content-type and others headers are not set correctly
- More globaly, FPM goal is NOT to serve static files. It's not been
design for this. Let apache and other web servers serve static files,
it's what they've been designed for !
- from a perfomances point of view, if you let FPM to server static
files, you'll get very poor performances.

>
> if not ! while be fun to add this, because they can be served simply
> with this apache module, like ajp protocole with tomcat !
> and with that solution you can separate apache reverse proxy and php
> server in two serveur and in two dmz if necessary !
>
> and you can be abel to loadbalance with the apache proxy mecanisme !
>
> in the past i've made modified version (not very optimized) of php-
> fastcgi sapi to handle that!
>
> the only thing is to be abel to handle php with php engine, and all
> other file as static file.
>
> An optimized version while be abel to handle Last-Modified and/or ETag
> http header...
> http://www.w3.org/Protocols/rfc2616/rfc2616-sec13.html#sec13.3.1
> with that you can use apache in reverse proxy with caching
> (mod_cache) !
>
> and you can combine all of that with mod_security!
>
> thank for this good peace of code!
> Mathieu
>
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 120
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready