When you work with Nginx Server as a Web Server or a Reverse Proxy Server, sometimes you might experience a "Bad Gateway" Error where Ingenx fails to load the Application. The solution to solving this problem in Ubuntu is by going to
var/logs/nginx
folder and then getting the error log file, and bringing it to the local machine to examine it. Most of the time the error looks like this:
2019/02/26 16:16:45 [error] 12544#12544: *5608 upstream sent too big header while reading response header from
2019/01/03 15:56:15 [error] 3694#3694: *36 upstream sent too big header while reading
response header from upstream, client: 98.987.8776, server: ,
request: "GET /dormainName HTTP/1.1",
upstream: "fastcgi://unix:/var/run/php/php7.2-fpm.sock:",
host: "176.098.87:81"
~ '\.php$|^/update.php' {} block?
include the code below for FastCGI to return/accept a large buffer.
fastcgi_max_temp_file_size 0;
fastcgi_buffers 128 2048k;
fastcgi_buffer_size 2048k;
fastcgi_read_timeout 600;
fastcgi_send_timeout 600;