fastcgi_catch_stderr

Syntax: fastcgi_catch_stderr string;
Default:
Context: http, server, location

Sets a string to search for in the error stream of a response received from a FastCGI server. If the string is found then it is considered that the FastCGI server has returned an invalid response. This allows handling application errors in nginx, for example:

1
2
3
4
5
6
location /php {
    fastcgi_pass backend:9000;
    ...
    fastcgi_catch_stderr "PHP Fatal error";
    fastcgi_next_upstream error timeout invalid_header;
}
doc_nginx
2025-01-10 15:47:30
Comments
Leave a Comment

Please login to continue.