• Home
  • WP tuts
  • Hosting talk
    • Free hosting
    • Cheap Hosting
    • comparison cloud , vps, shared, wordpress
    • managed wordpress hosting
    • managed cloud hosting
  • Speed up wordpress
  • Pc world
  • Services
  • About Me

RAaz Kumar .com

wordpress tutorials seo hosting etc

nginx errors (504,502, 413, unable to start, syntax errors)

* “504 Gateway Timeout NGINX”

504 Gateway Time-out
increase timeout limit or disable it in nginx conf
php
max_execution_time = 300
request_terminate_timeout = 300 (same as execution time if you un-comment it)
fastcgi_read_timeout 300;
sometimes timeout in  fastcgi,conf
    fastcgi_read_timeout 300;
//
    fastcgi_buffers 8 16k;
    fastcgi_buffer_size 32k;
    fastcgi_connect_timeout 90s;
    fastcgi_send_timeout 90s;
    fastcgi_read_timeout 90s;
    proxy_read_timeout 90s;
(if noting mentioned defaults are applicable
nginx as a proxy
  proxy_connect_timeout       300;
  proxy_send_timeout          300;
  proxy_read_timeout          300;
  send_timeout                300;
nginx disable gateway timeout
unfortunately no way to disable but you can increase upto 30 mins
300s = 5 mins
     fastcgi_read_timeout 300;
     proxy_read_timeout 300;
300s = 5 minutes then website loads at 5-7mins (should be in 2-3 secs)
for temporary requirement increase both php
mysql timeout
MySQL has its wait_timeout variable default value set to 28800 seconds (8 hours).

413 Request Entity Too Large

php
upload_max_filesize
post_max_size
at php.ini
    client_max_body_size 100M;  in nginx.conf
0 to disable.
client_header_timeout 3m;
client_body_timeout 3m;
send_timeout 3m;
client_max_body_size 100M;
nginx -s reload
LimitRequestBody 104857600 htaccess apache

502 bad gateway nginx ubuntu centos fix

nginx 502 bad gateway high traffic
522 error with cloudflare
increase fastcgi timeouts
browser >> web server>> application serer>> database serer
web server to wait (60s or 300s)
mostly in ms 2-3 seconds has to fully load.
check nginx error log
“fastcgi_connect_timeout” directive invalid value
41 client intended to send too large body
upstream timed out (php max execution time)
php or mysql too.
php-fpm related
php.ini
max_input_time
;   Default Value: -1 (Unlimited)
memory_limit = 512M
Maximum amount of memory a script may consume
upload_max_filesize = 400000M
Maximum allowed size for uploaded files.
request_terminate_timeout
max_execution_time = 120
input, execution, memory limit
input+execution= fastcgi read timeout
sendfile on; send_timeout 5m; client_header_timeout 5m; client_body_timeout 10; fastcgi_max_temp_file_size 2048m;
client_header_timeout 3m;
client_body_timeout 3m;
send_timeout 3m;
client_max_body_size 100M;

upstream timed out nginx php-fpm

fastcgi_read_timeout 120;
fastcgi_read_timeout 60s; //defaults
phpmyadmin
or
php
fastcgi timeout
\phpmyadmin\libraries\config.default.php
Open this configuration file in any editor and change $cfg[‘ExecTimeLimit’] = 300; to $cfg[‘ExecTimeLimit’] = 0;

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.

Tuning Nginx Performance Perfect nginx.conf

Related topics:

  1. nginx conf explained best config file performance tuning nginx.conf
  2. Top 10 GREP Commands in linux to search files
  3. Pagespeed module install, configure, monitor, errors ft nginx &apache
  4. mysql errors
  5. how to start import export business in india




tutorials

  • Android Studio tutorials syllabus Topics Course details #AndroidApplicationDevelopment
  • xampp tutorials 2021 installation errors fix wordpress phpmyadmin mysql apache
  • Devops Syllabus topics PDF
  • CCNA Syllabus pdf (CCNA / CCNP vs devops vs mcsa /MCSE)
  • how to create a website free of cost on google
  • what is vpn vs proxy vs tor, http vs https, http2, tcp vs udp, kali linux sql source code injection
  • nginx server tutorials (installation, configuration, performance tuning, security)
    • nginx modules list (enable, disable, upgrade, install dynamic module)
    • monitor nginx request with nginx status amplify datadog new relic
    • nginx installation on ubuntu 20.04 LTS
    • Redis performance metrics & tuning for nginx apache ubuntu & debian
    • enable brotli compression nginx brotli vs gzip
    • nginx performance tuning
    • Top 10 tips to improve nginx server security
    • letsencrypt install configure on ubuntu / debian nginx
    • what is TTFB & how to Reduce it (server response time) Google pagespeed
    • enable php fpm status page, monitor & understand the report to tweak performance
    • 2021 php fpm pool manager configuration settings based on server spike
    • Letsencrypt SSL Installation on apache/Nginx ubuntu / debian
    • nginx rewrite rules with examples 301 redirection
    • use nginx as reverse proxy and load balancer for apache wordpress
    • nginx conf explained best config file performance tuning nginx.conf
    • nginx errors (504,502, 413, unable to start, syntax errors)
    • Pagespeed module install, configure, monitor, errors ft nginx &apache
    • Apache vs nginx (connection handling, modules, memory usage)
    • install lemp Linux, Nginx 1.15.12, MySQL 8, PHP fpm 7.3 on Ubuntu 18.04
    • nginx fastcgi cache wordpress how to configure
    • Redis / memcached installation on ubuntu 20.04 with wordpress mysql configuration
    • cloudflare timeout error 522 524 fix by increasing limit
  • Vivek Bindra Videos Transcription (business strategy)
  • AUdio Editing Background Noise removal (Audacity, Adobe Premiere Addition, Camtasia Filmora Windows Obs)
  • MySQL Tutorial (create,connect database, update tables, export etc) Documentation & TIPS
  • [INTRO] Ethical hacking / cyber Security / Penetration testing Tutorial -{updates frequently}
  • ubuntu tutorials installation download issues etc
  • Php tutorials
  • HTML & CSS Tutorials
  • Core Java Tutorial Free online
  • Linux sysadmin tutorials linux system administrator
  • apache server tutorial (install,config, performance tuning, security, error handling)

About

 

raaz kumar comI am Raaz Kumar, Most Of the time in a day , I Spend on WordPress, Hosting, Server related issues, So i decided write clean posts from my personal notes, so it will be useful for every one like me. Read More,,

Please Support my work by sharing, it can helps to create free content like this.

Twitter

Facebook

Youtube

 

PUBG Mobile Tips & Tricks

free fire how to play (a-z guide) guns, tips & tricks etc

Windows 10 tips & tricks

Pagespeed optimization

Pc building tips & tricks

nginx server tutorials

apache server tutorials

linux sysadmin tutorials

mysql Commands list pdf

Android studio tutorials

Gaming/ streaming tips

Airtel dth channel list

 

wordpress

 

Top 5  WP Google Analytics Plugins

WP Backup Plugins

Wp Comment Plugins

Top wordpress Security Plugins

WP Seo Plugins

WP Caching Plugins

Best Adsense Plugins for WordPress

Wp social Sharing Plugins

autoshare social media plugins

WP speed Optimization Plugins

Speedup WordPress google Score

More Wp tuts

Server Admin Cloud

 

Installing Nginx LEMP On ubuntu

Installing apache Lamp ubuntu

nginx fastcgi cache enable

php – fpm install  & Configuration

Opcache install & Configure

php -fpm pool manager explained

Mysql Install & Configuration

Redis Object cache install & configure

 

Nginx as Reverse Proxy and Load balancer

Load Balance / auto scaling in google cloud

Linux Commands PDF

Mysql Commands Pdf

Letsencrypt tutorial

mysqldump export & import 

Pagespeed Module install & configure

nginx.conf best file

mysql.conf best file

upgrade ubuntu

© 2021 - All Rights Reserved Disclaimer & Privacy Policy