Skip to content

Commit 1b0fe77

Browse files
committed
feature #4708 Change Apache php-fpm proxy configuration (TeLiXj)
This PR was submitted for the 2.6 branch but it was merged into the 2.3 branch instead (closes #4708). Discussion ---------- Change Apache php-fpm proxy configuration | Q | A | ------------- | --- | Doc fix? | Yes | New docs? | No | Applies to | All | Fixed tickets | 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 Commits ------- 1873305 Update web_server_configuration.rst 41ac8c7 Update web_server_configuration.rst 71a24aa Update web_server_configuration.rst
2 parents 9819113 + 1873305 commit 1b0fe77

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

cookbook/configuration/web_server_configuration.rst

+9-2
Original file line numberDiff line numberDiff line change
@@ -132,8 +132,15 @@ 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 higher
136+
# Using SetHandler avoids issues with using ProxyPassMatch in combination
137+
# with mod_rewrite or mod_autoindex
138+
<FilesMatch \.php$>
139+
SetHandler proxy:fcgi://127.0.0.1:9000
140+
</FilesMatch>
141+
# If you use Apache version below 2.4.9 you must consider update or use this instead
142+
# ProxyPassMatch ^/(.*\.php(/.*)?)$ fcgi://127.0.0.1:9000/var/www/project/web/$1
143+
137144
DocumentRoot /var/www/project/web
138145
<Directory /var/www/project/web>
139146
# enable the .htaccess rewrites

0 commit comments

Comments
 (0)