Nginx fastcgi always include the request body with the response Nginx fastcgi always include the request body with the response docker docker

Nginx fastcgi always include the request body with the response


I have a same issue on nginx:latest + php-fpm7.4

When I restart docker container, the problem goes away for a while.However about 4~6 hours layer, auto_prepend_file option in PHP.ini, automatically changed to "php://input" and allow_url_fopen option changed to "On".

And a request which try to download and execute a file "http://194.38.20.199/p.sh" was detected by nginx log.(I think this request is regards to this problem)

So, I block the request through IP (not domain) in my nginx config.And then, the problem was solved temporarily.


I was encountering this issue as well using nginx and php-fpm7.4.

I'm not sure what causes the issue, but I resolved the issue by passing: fastcgi_param PHP_VALUE "auto_prepend_file= \n allow_url_include=Off" ; in the location section on the nginx .conf.