NGinx and Apache display errors differently when there is a problem running a PHP script. Apache, when configured to display on screen, accurately displays the error, with file and line where it occurred, but NGinx typically only displays something like 502 bad gateway .
Most solutions, even on stackoverflow.com in English, at most help set upNGinx
and PHP-FPM
to direct errors to a text file, but I personally could not get NGinx to display the exactly errors as Apache would make. I understand that in production it is not ideal to display screen errors for the user, however a constant problem when using NGinx instead of Apache for a developer to test your application is that most have difficulty debugging just by looking at log files.
By exactly I specify that it is all possible errors that theoretically NGinx could display. If a php-fpm worker is not active or has serious problems it would be acceptable to still have the same errors.