In Nginx + PHP-FPM configuration I have a .php file with the following content:
<?php
header("HTTP/1.1 405 Method Not Allowed");
echo 'hi';
?>
Now, if I want to force Nginx to ignore such this HTTP Status codes originating from PHP scripts, what should I do in Nginx config file? In other words, I want to Nginx dismiss custom status headers and ignore them (replace them with Status: 200 OK i.e.).
I have read Nginx documentation about fastcgi and didn’t find any useful directive for this purpose. Also, fastcgi_intercept_errors is not the solution.