Apache force transfer-encoding chunked after update to version 2.4.62
0
votes
0
answers
25
views
I'm running Apache with PHP-FPM on a RHEL 9 server. After updating Apache from version 2.4.57 to 2.4.62, all HTTP responses now include the T**ransfer-Encoding: chunked** header, even when the PHP script explicitly sets the Content-Length header.
I haven't made any changes to the Apache or PHP configuration files. Here’s a simple PHP script I used to test the response behavior. When I run this on Apache 2.4.57, it works correctly and the response includes the **Content-Length** header. However, the same PHP script on Apache 2.4.62 results in a response with the **Transfer-Encoding: chunked** header instead.
true]);
header("Content-length: ".strlen($response));
header("Content-type: application/json");
echo($response);
?>
Here is my site conf file
LoadModule rewrite_module modules/mod_rewrite.so
LoadModule status_module modules/mod_status.so
Listen 443
ServerAdmin admin@smartySSL.com
DocumentRoot /var/www/smarty
SSLEngine On
SSLOptions +StrictRequire
SSLProtocol +TLSv1.2 -TLSv1.1 -TLSv1 -SSLv3
SSLCipherSuite HIGH:!MEDIUM:!LOW:!NULL:!aNULL:!MD5:!RC4
SSLCertificateFile /etc/pki/tls/certs/ca.crt
SSLCertificateKeyFile /etc/pki/tls/private/ca.key
KeepAliveTimeout 10
SetEnvIf Request_URI ".*" no-gzip
SetEnv proxy-sendcl
LogLevel proxy:trace6
TraceEnable Off
Options -Indexes
# Proxy declaration
# we must declare a parameter in here (doesn't matter which) or
# it'll not register the proxy ahead of time
ProxySet disablereuse=off
# Note: If you configure php-fpm to use the "pm = ondemand"
#then use "ProxySet disablereuse=on"
SetHandler proxy:fcgi://php-fpm
SetEnv proxy-sendcl 1
LogLevel debug
ErrorLog logs/smartySSL.com-error.log
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-agent}i\" \"%{Connection}i\" %k" my_combined
CustomLog logs/smartySSL.com-access.log my_combined
Alias /prodTest /var/www/prod_testing_smarty
#disabilita il listing
Options -Indexes
Require ip 127.0.0.1
SetHandler server-status
Allow from 127.0.0.1
Allow from ::1
Deny from all
Order Allow,Deny
Allow from 127.0.0.1
Allow from ::1
ProxyPass unix:/run/php-fpm/www.sock|fcgi://localhost/fpm-status
RewriteEngine on
RewriteRule ^/TcpWeb/rest/FWUpdate/(v[0-9]+)/([A-Z][0-9]+) /rest/get_fwUpdate.php?version=$1&id=$2&%{QUERY_STRING} [END]
RewriteCond %{QUERY_STRING} ^([^&]+)
RewriteRule ^/TcpWeb/rest/GetAll/(v[0-9]+)/([A-Z][0-9]+)/?$ /rest/get_all.php?version=$1&id=$2&%{QUERY_STRING} [END]
RewriteRule ^/TcpWeb/rest/PutAll/(v[0-9]+)/([A-Z][0-9]+) /rest/put_all.php?version=$1&id=$2 [END]
RewriteRule ^/TcpWeb/rest/DiagnosticLog/(v[0-9]+)/([A-Z][0-9]+) /rest/put_diagnosticLog.php?version=$1&id=$2 [END]
RewriteCond %{REQUEST_METHOD} ^TRACE
RewriteRule .* -[F]
I can't use **Transfer-Encoding: chunked** header since is not supported by our embedded devices.
Any ideas ? Thanks
Asked by Riccardo Crociani
(1 rep)
Jul 11, 2025, 06:33 AM