4

I have a running Apache 2.4 + PHP-FPM setup.

There is one edge case though, when this setup fails - when using Chromelogger. Chromelogger is a server to client debugging tool, which sends it's data through a HTTP header to a browser. The header's value is usually very long, which causes the mod_proxy_fcgi to fail with a following error:

[proxy_fcgi:error] [pid 10452:tid 1912] [client 127.0.0.1:61175] Premature end of script headers: index.php
[proxy_fcgi:error] [pid 10452:tid 1912] [client 127.0.0.1:61175] AH01070: Error parsing script headers

I tried increasing Apache's LimitRequestFieldSize, but it has no effect on this issue.

My setup in short is as follows:

httpd.conf:

LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_fcgi_module modules/mod_proxy_fcgi.so

...

<Files ~ "\.(php|phtml)$">
    SetHandler "proxy:fcgi://127.0.0.1:9072#"
</Files>

php.ini

cgi.fix_pathinfo=0

On a side note: The issue does NOT occur, when PHP is running as a module, but it occurs when PHP is running as non-FPM FastCGI.

The header causing the error is returned on GET requests. "X-ChromeLogger-Data" has a value with length of 18716 characters. The value itself is a base64 encoded json object.

I could not find any variable in either mod_proxy or mod_proxy_fcgi that would increase the header limit.
What am I missing? Is there another Apache variable that would help in this case?

Thank you.

mgo
  • 141
  • 3
  • Maybe that the http://de2.php.net/manual/en/ini.core.php#ini.post-max-size is different for the module and the fpm? – Aleksandar Dec 17 '17 at 11:30
  • Dear Aleksandar, The issue occurs on GET requests. Thank you – mgo Dec 17 '17 at 11:31
  • how big are the headers and the request in general? – Aleksandar Dec 17 '17 at 11:40
  • Dear Aleksandar, It is one header with name of "X-ChromeLogger-Data" and value with length of 18716 characters. The value itself is a base64 encoded json object. – mgo Dec 17 '17 at 11:48
  • what's with the "#" at the end of the Sethandler directive? – ezra-s Dec 18 '17 at 08:23
  • Not entirely sure, but without it - it wouldn't work: 400 Proxy Error: fcgi://127.0.0.1:9072 "URI cannot be parsed" – mgo Dec 18 '17 at 08:59
  • @mgo switch it to a trailing slash "/" just in case. – ezra-s Dec 20 '17 at 08:58
  • Dear ezra, Thank you. / also fixes Proxy Error. Any ideas to the header length limit? It is interesting that there is no solution ;-) – mgo Dec 21 '17 at 17:36

0 Answers0