-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Change Apache php-fpm proxy configuration #4708
Conversation
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
@@ -132,8 +132,14 @@ 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 upper |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[...] or higher
Updated! Thanks xabbuh |
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you also please wrap this line after the first word that crosses the 72nd character?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
@TeLiXj Thanks for providing the patch and for your fast reaction. 👍 |
@xabbuh thanks for ur work here!!! :) |
Wow, very well-researched @TeLiXj! Thanks very much for this! |
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
@TeLiXj I just noticed that the introduction now doesn't cover the configuration anymore. I started to reword it, but now I'm wondering if one still needs mod_proxy and mod_proxy_fcgi to be able to use the |
Of course, you always need mod_proxy and mod_proxy_fcgi to enable fpm-php on Apache. |
@TeLiXj Thank you, this helps me very much. And by the way, happy new year to you! |
…not ProxyPassMatch) (xabbuh) This PR was merged into the 2.3 branch. Discussion ---------- [Cookbook][Configuration] update text to use SetHandler (not ProxyPassMatch) | Q | A | ------------- | --- | Doc fix? | yes | New docs? | no | Applies to | all | Fixed tickets | This reflects the changes to the default configuration introduced with #4708 in the introduction. Commits ------- 9d84d03 update text to use SetHandler (not ProxyPassMatch)
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