* “504 Gateway Timeout NGINX”
413 Request Entity Too Large
502 bad gateway nginx ubuntu centos fix
upstream timed out nginx php-fpm
Nginx Syntax errors in nginx.conf or serverblocks
nginx – s reload
Nginx -t
fix the errors
nginx unable to start
Simple but Complicated,
Finding running nginx in running Process using Grep Command.
$ ps aux | grep nginx
root@instance-1:~# ps aux | grep nginx
ps aux -P | grep nginx
www-data 2665 0.0 0.4 163360 18672 ? S Jul08 0:58 nginx: worker p rocess
www-data 2666 0.0 0.4 163080 18172 ? S Jul08 0:01 nginx: worker p rocess
www-data 2667 0.0 0.3 163080 14600 ? S Jul08 0:00 nginx: cache ma nager process
root 5210 0.0 0.0 14852 1040 pts/0 S+ 12:53 0:00 grep –color=au to nginx
root 23446 0.0 0.3 158700 15916 ? Ss Mar13 0:04 nginx: master p rocess /usr/sbin/nginx -c /etc/nginx/nginx.conf
Kill Nginx Process and restart
Kill the Process by its number.
kill: 2665
less /var/log/nginx/error.log
netstat -tulpn | grep :80 (to know which application occupied this port)
Then again Start the Nginx , If any syntax errors in config files fix and start.
reinstall the web server nothing gonna lose except config file so back it up.
cloudflare 522 error fix
just increase the timeout limit both php & nginx. 1 minutes to 5 minutes not necessary.(mens there is cpu outage so its taking long time.
also read speed up website in 3 seconds
Nginx error log location
/var/log/nginx/error. log
try this command
less /var/log/nginx/error.log
last 10 lines.
and understand the errors related php-fpm errors or wordpress errors, mysql etc related.