Skip to content

Commit

Permalink
feature #4708 Change Apache php-fpm proxy configuration (TeLiXj)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
weaverryan committed Jan 3, 2015
2 parents 9819113 + 1873305 commit 1b0fe77
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions cookbook/configuration/web_server_configuration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,15 @@ directive to pass requests for PHP files to PHP FPM:
#
# SetEnvIfNoCase ^Authorization$ "(.+)" HTTP_AUTHORIZATION=$1
ProxyPassMatch ^/(.*\.php(/.*)?)$ fcgi://127.0.0.1:9000/var/www/project/web/$1
# For Apache 2.4.9 or higher
# Using SetHandler avoids issues with using ProxyPassMatch in combination
# with mod_rewrite or mod_autoindex
<FilesMatch \.php$>
SetHandler proxy:fcgi://127.0.0.1:9000
</FilesMatch>
# If you use Apache version below 2.4.9 you must consider update or use this instead
# ProxyPassMatch ^/(.*\.php(/.*)?)$ fcgi://127.0.0.1:9000/var/www/project/web/$1
DocumentRoot /var/www/project/web
<Directory /var/www/project/web>
# enable the .htaccess rewrites
Expand Down

0 comments on commit 1b0fe77

Please sign in to comment.