Answer the question
In order to leave comments, you need to log in
Why do Wordpress + Nginx get 502/504 errors?
Hello.
There was a Wordpress site on an Nginx server.
For 5-6 months everything worked fine, a month ago 502 errors began to fly steadily
. There was such an error in the logs /var/log/error.log
2016/01/18 03:58:54 [error] 13245#0: *125039 connect()
to unix:/var/run/php5-fpm.sock failed (11: Resource temporarily unavailable) while connecting to upstream,
client: 74.217.28.153, server: www.d2battle.club, request: "POST /xmlrpc.php HTTP/1.0", upstream:
"fastcgi://unix:/var/run/php5-fpm.sock:", host: "188.166.31.15"
2016/01/19 02:37:38 [error] 3677#0: *5484 upstream timed out (110: Connection timed out)
while reading response header from upstream, client: 66.249.66.148, server: www.d2battle.club, request:
"GET /done_battles/11/ HTTP/1.1", upstream: "fastcgi://127.0.0.1:7777", host: "d2battle.club
2016/01/18 04:43:23 [crit] 13245#0: *125168 connect() to unix:/var/run/php5-fpm.sock failed (2: No such file or directory)
while connecting to upstream, client: 176.209.206.24, server: www.d2battle.club, request: "GET /favicon.ico HTTP/1.1",
upstream: "fastcgi://unix:/var/run/php5-fpm.sock:", host: "d2battle.club", referrer: "http://d2battle.club/"
user www-data; worker_processes 4; pid /run/nginx.pid;
events { worker_connections 768; # multi_accept on; }
http {
sendfile on; tcp_nopush on; tcp_nodelay on; keepalive_timeout 65; types_hash_max_size 2048; # server_tokens off;
# server_names_hash_bucket_size 64; # server_name_in_redirect off;
include /etc/nginx/mime.types; default_type application/octet-stream;
## # Logging Settings ##
access_log /var/log/nginx/access.log; error_log /var/log/nginx/error.log;
## # Gzip Settings ##
gzip on; gzip_disable "msie6";
# gzip_vary on; # gzip_proxied any; # gzip_comp_level 6; # gzip_buffers 16 8k; # gzip_http_version 1.1; # gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript;
## # nginx-naxsi config ## # Uncomment it if you installed nginx-naxsi ##
#include /etc/nginx/naxsi_core.rules;
## # nginx-passenger config ## # Uncomment it if you installed nginx-passenger ## #passenger_root /usr; #passenger_ruby /usr/bin/ruby;
## # Virtual Host Configs ##
include /etc/nginx/conf.d/.conf; include /etc/nginx/sites-enabled/; }
2016/01/29 02:43:01 [error] 3632#0: *3918 upstream timed out (110: Connection timed out) while reading response header from upstream, client: 176.209.192.39, server: www.d2battle.club, request: "GET /favicon.ico HTTP/1.1", upstream: "fastcgi://127.0.0.1:7777", host: "d2battle.club", referrer: "http://d2battle.club/wp-admin/plugins.php?action=delete-selected&checked%5B0%5D=wp-super-edit%2Fwp-super-edit.php&plugin_status=all&paged=1&s&_wpnonce=852a3bede6"
[29-Jan-2016 02:53:25] WARNING: [pool www] child 3765 exited on signal 15 (SIGTERM) after 50.005905 seconds from start
[29-Jan-2016 02:53:25] NOTICE: [pool www] child 3768 started
[29-Jan-2016 02:54:25] WARNING: [pool www] child 3753, script '/home/webmaster/www/www.d2battle.club/xmlrpc.php' (request: "POST /xmlrpc.php") execution timed out (30.781351 sec), terminating
[29-Jan-2016 02:54:25] WARNING: [pool www] child 3753 exited on signal 15 (SIGTERM) after 480.050784 seconds from start
[29-Jan-2016 02:54:25] NOTICE: [pool www] child 3769 started
[29-Jan-2016 02:55:45] WARNING: [pool www] child 3762, script '/home/webmaster/www/www.d2battle.club/xmlrpc.php' (request: "POST /xmlrpc.php") execution timed out (34.839108 sec), terminating
[29-Jan-2016 02:55:45] WARNING: [pool www] child 3762 exited on signal 15 (SIGTERM) after 330.039058 seconds from start
[29-Jan-2016 02:55:45] NOTICE: [pool www] child 3770 started
Answer the question
In order to leave comments, you need to log in
Check the permissions on the /var/run/php5-fpm.sock socket file. The www-data user must have access to it.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question