Skip to content

Commit 71a24aa

Browse files
TeLiXjweaverryan
authored andcommitted
Update web_server_configuration.rst
I had problems using ProxyPassMatch and mod_rewrite and now I use SetHandler to send the request to proxy. This change works fine and should be the standar configuration in the future for Apache and php-fpm. You can read the php developers discussion here http://www.serverphorums.com/read.php?7,956732 or some about problems fixed here http://blog.famillecollet.com/post/2014/03/28/PHP-FPM-and-HTTPD-2.4-improvement
1 parent 9819113 commit 71a24aa

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

cookbook/configuration/web_server_configuration.rst

+8-2
Original file line numberDiff line numberDiff line change
@@ -132,8 +132,14 @@ directive to pass requests for PHP files to PHP FPM:
132132
#
133133
# SetEnvIfNoCase ^Authorization$ "(.+)" HTTP_AUTHORIZATION=$1
134134
135-
ProxyPassMatch ^/(.*\.php(/.*)?)$ fcgi://127.0.0.1:9000/var/www/project/web/$1
136-
135+
# For Apache 2.4.9 or upper
136+
# This avoid problems with ProxyPassMatch and mod_rewrite or mod_autoindex
137+
<FilesMatch \.php$>
138+
SetHandler proxy:fcgi://127.0.0.1:9000
139+
</FilesMatch>
140+
# If you use Apache version below 2.4.9 you must consider update or use this instead
141+
# ProxyPassMatch ^/(.*\.php(/.*)?)$ fcgi://127.0.0.1:9000/var/www/project/web/$1
142+
137143
DocumentRoot /var/www/project/web
138144
<Directory /var/www/project/web>
139145
# enable the .htaccess rewrites

0 commit comments

Comments
 (0)