Apache 2.4 PHP-FPM: Authorization Headers Problem
Issue:
Authorization headers are not being passed from Apache 2.4's mod_proxy to PHP-FPM, preventing access to certain features, such as APC's user cache monitoring.
Solution:
1. Identify the Stripping Module:
Determine which Apache module is stripping the Authorization headers. This may require extensive debugging or checking module configurations.
2. Override Module Settings:
Find the specific configuration setting within the problematic module that allows you to preserve the Authorization headers. This setting varies depending on the module.
3. Pass Headers via Env Variables:
If overriding module settings is not possible, you can pass the Authorization header directly to PHP using environment variables:
<code class="apache">SetEnvIf Authorization "(.*)" HTTP_AUTHORIZATION=</code>
4. Update PHP Code:
In some cases, you may need to modify your PHP code to access the Authorization header using $_SERVER['REDIRECT_HTTP_AUTHORIZATION'] instead of $_SERVER['HTTP_AUTHORIZATION'].
The above is the detailed content of How to Fix Authorization Headers Problem in Apache 2.4 PHP-FPM?. For more information, please follow other related articles on the PHP Chinese website!