502 errors on WordPress / nginx / php5-fpm The 2019 Stack Overflow Developer Survey Results Are InBlank Page: wordpress on nginx+php-fpmConfigure php5-fpm for many concurrent usersphpmyadmin having problems on nginx and php-fpm on RHEL 6NGINX don't parse .php5 as .phpLaravel 4.1 on nginx routes error 404nginx rewrite throw 404 with last and breakNginX + WordPress + SSL + non-www + W3TC vhost config file questionsnginx PHP files downloading instead of executingCodeIgniter nginx rewrite rules for i8ln URL'sNGINX virtual host config for Magento2 in a subfolder
Why didn't the Event Horizon Telescope team mention Sagittarius A*?
What did it mean to "align" a radio?
Can someone be penalized for an "unlawful" act if no penalty is specified?
A poker game description that does not feel gimmicky
Multiply Two Integer Polynomials
Is "plugging out" electronic devices an American expression?
Why is the maximum length of OpenWrt’s root password 8 characters?
The difference between dialogue marks
Loose spokes after only a few rides
Did Scotland spend $250,000 for the slogan "Welcome to Scotland"?
Why is the Constellation's nose gear so long?
Return to UK after having been refused entry years ago
Where to refill my bottle in India?
Did 3000BC Egyptians use meteoric iron weapons?
Is this app Icon Browser Safe/Legit?
Why was M87 targetted for the Event Horizon Telescope instead of Sagittarius A*?
Why do UK politicians seemingly ignore opinion polls on Brexit?
"as much details as you can remember"
Why isn't the circumferential light around the M87 black hole's event horizon symmetric?
Time travel alters history but people keep saying nothing's changed
How technical should a Scrum Master be to effectively remove impediments?
One word riddle: Vowel in the middle
If a Druid sees an animal’s corpse, can they Wild Shape into that animal?
Have you ever entered Singapore using a different passport or name?
502 errors on WordPress / nginx / php5-fpm
The 2019 Stack Overflow Developer Survey Results Are InBlank Page: wordpress on nginx+php-fpmConfigure php5-fpm for many concurrent usersphpmyadmin having problems on nginx and php-fpm on RHEL 6NGINX don't parse .php5 as .phpLaravel 4.1 on nginx routes error 404nginx rewrite throw 404 with last and breakNginX + WordPress + SSL + non-www + W3TC vhost config file questionsnginx PHP files downloading instead of executingCodeIgniter nginx rewrite rules for i8ln URL'sNGINX virtual host config for Magento2 in a subfolder
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;
I've looked through lots of other Server Fault and Google results that all have talk about generally similar situations, but I can't quite find the insight that I'm looking for. I would appreciate any help that the community can provide, and don't want anyone thinking that I didn't do an exhaustive amount of research before asking for help. I truly appreciate anyone who takes the to respond and educate me on this.
Here's the situation:
I have a Digital Ocean server with an 8 core processor, 16 GB RAM, and 160 GB SSD. The server is running WordPress on nginx + php5-fpm on Ubuntu 14.04.2 LTS.
I've always used Apache in the past, so this is my first foray into nginx.
Anyway, the site is running fine but I'm getting 502 bad gateway errors occasionally, and have had reports that users are also experience this problem on an intermittent basis. I have fairly aggressive edge caching with CloudFlare, to limit the number of hits to the actual original server.
The nginx error logs show a common problem:
2015/07/03 17:38:51 [error] 4283#0: *74154 connect() to unix:/var/run/php5-fpm.sock failed (11: Resource temporarily unavailable) while connecting to upstream, client: 173.245.xx.xx, server: www.mydomain.com, request: "GET /path/to/file HTTP/1.1", upstream: "fastcgi://unix:/var/run/php5-fpm.sock:
I'm finding that these entries correspond with the 502 scenario, but what I can't figure out is how to effective tune the php5-fpm and nginx to support the traffic.
top
shows %Cpu(s): fluctuating between 27% and 54% during the several different times that I've been monitoring.
Memory usage also seems fine to me; here's the output from free -h
:
total used free shared buffers cached
Mem: 15G 15G 248M 71M 1.3G 11G
-/+ buffers/cache: 2.3G 13G
Swap: 0B 0B 0B
Finally, turning to the nginx configuration, based on what I read, I have the worker_processes set to 8, with 16192 worker_connections. Here's what the /etc/nginx/nginx.conf
looks like:
user www-data;
worker_processes 8;
pid /run/nginx.pid;
events
worker_connections 16192;
multi_accept on;
use epoll;
http
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 15;
types_hash_max_size 2048;
include /etc/nginx/mime.types;
default_type application/octet-stream;
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;
gzip on;
gzip_disable "msie6";
include /etc/nginx/conf.d/*.conf;
include /etc/nginx/sites-enabled/*;
And here's the config from /etc/nginx/sites-available/default
fastcgi_cache_key "$host$request_uri";
fastcgi_cache_use_stale error timeout invalid_header http_500;
fastcgi_ignore_headers Cache-Control Expires Set-Cookie;
server
listen 80 default_server;
listen [::]:80 default_server ipv6only=on;
listen 127.0.0.1 default_server;
root /usr/share/nginx/html;
index index.php index.html index.htm;
server_name my.website.com;
server_name localhost;
location /
try_files $uri $uri/ =404;
error_page 404 /404.html;
error_page 500 502 503 504 /50x.html;
location = /50x.html
root /usr/share/nginx/html;
location ~ .php$
try_files $uri =404;
fastcgi_split_path_info ^(.+.php)(/.+)$;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
location ~ .php$
fastcgi_split_path_info ^(.+.php)(/.+)$;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
Final note: There are virtual hosts running on this machine too, each of which has a similar site config with fastcgi caching, and each is running WordPress.
Adding the config file for one of the vhosts, at the suggestion of @pennywise. I'm leaving my comments inline.
fastcgi_cache_path /etc/nginx/cache/vhostdomain levels=1:2 keys_zone=vhostdomain:100m inactive=60m;
server eot
Adding /etc/php5/fpm/pool.d/www.conf
sans comments:
[www]
user = www-data
group = www-data
listen = /var/run/php5-fpm.sock
listen.owner = www-data
listen.group = www-data
pm = dynamic
pm.max_children = 5
pm.start_servers = 2
pm.min_spare_servers = 1
pm.max_spare_servers = 3
chdir = /
ubuntu nginx php-fpm wordpress
add a comment |
I've looked through lots of other Server Fault and Google results that all have talk about generally similar situations, but I can't quite find the insight that I'm looking for. I would appreciate any help that the community can provide, and don't want anyone thinking that I didn't do an exhaustive amount of research before asking for help. I truly appreciate anyone who takes the to respond and educate me on this.
Here's the situation:
I have a Digital Ocean server with an 8 core processor, 16 GB RAM, and 160 GB SSD. The server is running WordPress on nginx + php5-fpm on Ubuntu 14.04.2 LTS.
I've always used Apache in the past, so this is my first foray into nginx.
Anyway, the site is running fine but I'm getting 502 bad gateway errors occasionally, and have had reports that users are also experience this problem on an intermittent basis. I have fairly aggressive edge caching with CloudFlare, to limit the number of hits to the actual original server.
The nginx error logs show a common problem:
2015/07/03 17:38:51 [error] 4283#0: *74154 connect() to unix:/var/run/php5-fpm.sock failed (11: Resource temporarily unavailable) while connecting to upstream, client: 173.245.xx.xx, server: www.mydomain.com, request: "GET /path/to/file HTTP/1.1", upstream: "fastcgi://unix:/var/run/php5-fpm.sock:
I'm finding that these entries correspond with the 502 scenario, but what I can't figure out is how to effective tune the php5-fpm and nginx to support the traffic.
top
shows %Cpu(s): fluctuating between 27% and 54% during the several different times that I've been monitoring.
Memory usage also seems fine to me; here's the output from free -h
:
total used free shared buffers cached
Mem: 15G 15G 248M 71M 1.3G 11G
-/+ buffers/cache: 2.3G 13G
Swap: 0B 0B 0B
Finally, turning to the nginx configuration, based on what I read, I have the worker_processes set to 8, with 16192 worker_connections. Here's what the /etc/nginx/nginx.conf
looks like:
user www-data;
worker_processes 8;
pid /run/nginx.pid;
events
worker_connections 16192;
multi_accept on;
use epoll;
http
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 15;
types_hash_max_size 2048;
include /etc/nginx/mime.types;
default_type application/octet-stream;
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;
gzip on;
gzip_disable "msie6";
include /etc/nginx/conf.d/*.conf;
include /etc/nginx/sites-enabled/*;
And here's the config from /etc/nginx/sites-available/default
fastcgi_cache_key "$host$request_uri";
fastcgi_cache_use_stale error timeout invalid_header http_500;
fastcgi_ignore_headers Cache-Control Expires Set-Cookie;
server
listen 80 default_server;
listen [::]:80 default_server ipv6only=on;
listen 127.0.0.1 default_server;
root /usr/share/nginx/html;
index index.php index.html index.htm;
server_name my.website.com;
server_name localhost;
location /
try_files $uri $uri/ =404;
error_page 404 /404.html;
error_page 500 502 503 504 /50x.html;
location = /50x.html
root /usr/share/nginx/html;
location ~ .php$
try_files $uri =404;
fastcgi_split_path_info ^(.+.php)(/.+)$;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
location ~ .php$
fastcgi_split_path_info ^(.+.php)(/.+)$;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
Final note: There are virtual hosts running on this machine too, each of which has a similar site config with fastcgi caching, and each is running WordPress.
Adding the config file for one of the vhosts, at the suggestion of @pennywise. I'm leaving my comments inline.
fastcgi_cache_path /etc/nginx/cache/vhostdomain levels=1:2 keys_zone=vhostdomain:100m inactive=60m;
server eot
Adding /etc/php5/fpm/pool.d/www.conf
sans comments:
[www]
user = www-data
group = www-data
listen = /var/run/php5-fpm.sock
listen.owner = www-data
listen.group = www-data
pm = dynamic
pm.max_children = 5
pm.start_servers = 2
pm.min_spare_servers = 1
pm.max_spare_servers = 3
chdir = /
ubuntu nginx php-fpm wordpress
You need to read your fpm logs. If nginx says unable to connect, fpm is going to be saying something more specific.
– AD7six
Jul 5 '15 at 5:59
add a comment |
I've looked through lots of other Server Fault and Google results that all have talk about generally similar situations, but I can't quite find the insight that I'm looking for. I would appreciate any help that the community can provide, and don't want anyone thinking that I didn't do an exhaustive amount of research before asking for help. I truly appreciate anyone who takes the to respond and educate me on this.
Here's the situation:
I have a Digital Ocean server with an 8 core processor, 16 GB RAM, and 160 GB SSD. The server is running WordPress on nginx + php5-fpm on Ubuntu 14.04.2 LTS.
I've always used Apache in the past, so this is my first foray into nginx.
Anyway, the site is running fine but I'm getting 502 bad gateway errors occasionally, and have had reports that users are also experience this problem on an intermittent basis. I have fairly aggressive edge caching with CloudFlare, to limit the number of hits to the actual original server.
The nginx error logs show a common problem:
2015/07/03 17:38:51 [error] 4283#0: *74154 connect() to unix:/var/run/php5-fpm.sock failed (11: Resource temporarily unavailable) while connecting to upstream, client: 173.245.xx.xx, server: www.mydomain.com, request: "GET /path/to/file HTTP/1.1", upstream: "fastcgi://unix:/var/run/php5-fpm.sock:
I'm finding that these entries correspond with the 502 scenario, but what I can't figure out is how to effective tune the php5-fpm and nginx to support the traffic.
top
shows %Cpu(s): fluctuating between 27% and 54% during the several different times that I've been monitoring.
Memory usage also seems fine to me; here's the output from free -h
:
total used free shared buffers cached
Mem: 15G 15G 248M 71M 1.3G 11G
-/+ buffers/cache: 2.3G 13G
Swap: 0B 0B 0B
Finally, turning to the nginx configuration, based on what I read, I have the worker_processes set to 8, with 16192 worker_connections. Here's what the /etc/nginx/nginx.conf
looks like:
user www-data;
worker_processes 8;
pid /run/nginx.pid;
events
worker_connections 16192;
multi_accept on;
use epoll;
http
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 15;
types_hash_max_size 2048;
include /etc/nginx/mime.types;
default_type application/octet-stream;
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;
gzip on;
gzip_disable "msie6";
include /etc/nginx/conf.d/*.conf;
include /etc/nginx/sites-enabled/*;
And here's the config from /etc/nginx/sites-available/default
fastcgi_cache_key "$host$request_uri";
fastcgi_cache_use_stale error timeout invalid_header http_500;
fastcgi_ignore_headers Cache-Control Expires Set-Cookie;
server
listen 80 default_server;
listen [::]:80 default_server ipv6only=on;
listen 127.0.0.1 default_server;
root /usr/share/nginx/html;
index index.php index.html index.htm;
server_name my.website.com;
server_name localhost;
location /
try_files $uri $uri/ =404;
error_page 404 /404.html;
error_page 500 502 503 504 /50x.html;
location = /50x.html
root /usr/share/nginx/html;
location ~ .php$
try_files $uri =404;
fastcgi_split_path_info ^(.+.php)(/.+)$;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
location ~ .php$
fastcgi_split_path_info ^(.+.php)(/.+)$;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
Final note: There are virtual hosts running on this machine too, each of which has a similar site config with fastcgi caching, and each is running WordPress.
Adding the config file for one of the vhosts, at the suggestion of @pennywise. I'm leaving my comments inline.
fastcgi_cache_path /etc/nginx/cache/vhostdomain levels=1:2 keys_zone=vhostdomain:100m inactive=60m;
server eot
Adding /etc/php5/fpm/pool.d/www.conf
sans comments:
[www]
user = www-data
group = www-data
listen = /var/run/php5-fpm.sock
listen.owner = www-data
listen.group = www-data
pm = dynamic
pm.max_children = 5
pm.start_servers = 2
pm.min_spare_servers = 1
pm.max_spare_servers = 3
chdir = /
ubuntu nginx php-fpm wordpress
I've looked through lots of other Server Fault and Google results that all have talk about generally similar situations, but I can't quite find the insight that I'm looking for. I would appreciate any help that the community can provide, and don't want anyone thinking that I didn't do an exhaustive amount of research before asking for help. I truly appreciate anyone who takes the to respond and educate me on this.
Here's the situation:
I have a Digital Ocean server with an 8 core processor, 16 GB RAM, and 160 GB SSD. The server is running WordPress on nginx + php5-fpm on Ubuntu 14.04.2 LTS.
I've always used Apache in the past, so this is my first foray into nginx.
Anyway, the site is running fine but I'm getting 502 bad gateway errors occasionally, and have had reports that users are also experience this problem on an intermittent basis. I have fairly aggressive edge caching with CloudFlare, to limit the number of hits to the actual original server.
The nginx error logs show a common problem:
2015/07/03 17:38:51 [error] 4283#0: *74154 connect() to unix:/var/run/php5-fpm.sock failed (11: Resource temporarily unavailable) while connecting to upstream, client: 173.245.xx.xx, server: www.mydomain.com, request: "GET /path/to/file HTTP/1.1", upstream: "fastcgi://unix:/var/run/php5-fpm.sock:
I'm finding that these entries correspond with the 502 scenario, but what I can't figure out is how to effective tune the php5-fpm and nginx to support the traffic.
top
shows %Cpu(s): fluctuating between 27% and 54% during the several different times that I've been monitoring.
Memory usage also seems fine to me; here's the output from free -h
:
total used free shared buffers cached
Mem: 15G 15G 248M 71M 1.3G 11G
-/+ buffers/cache: 2.3G 13G
Swap: 0B 0B 0B
Finally, turning to the nginx configuration, based on what I read, I have the worker_processes set to 8, with 16192 worker_connections. Here's what the /etc/nginx/nginx.conf
looks like:
user www-data;
worker_processes 8;
pid /run/nginx.pid;
events
worker_connections 16192;
multi_accept on;
use epoll;
http
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 15;
types_hash_max_size 2048;
include /etc/nginx/mime.types;
default_type application/octet-stream;
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;
gzip on;
gzip_disable "msie6";
include /etc/nginx/conf.d/*.conf;
include /etc/nginx/sites-enabled/*;
And here's the config from /etc/nginx/sites-available/default
fastcgi_cache_key "$host$request_uri";
fastcgi_cache_use_stale error timeout invalid_header http_500;
fastcgi_ignore_headers Cache-Control Expires Set-Cookie;
server
listen 80 default_server;
listen [::]:80 default_server ipv6only=on;
listen 127.0.0.1 default_server;
root /usr/share/nginx/html;
index index.php index.html index.htm;
server_name my.website.com;
server_name localhost;
location /
try_files $uri $uri/ =404;
error_page 404 /404.html;
error_page 500 502 503 504 /50x.html;
location = /50x.html
root /usr/share/nginx/html;
location ~ .php$
try_files $uri =404;
fastcgi_split_path_info ^(.+.php)(/.+)$;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
location ~ .php$
fastcgi_split_path_info ^(.+.php)(/.+)$;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
Final note: There are virtual hosts running on this machine too, each of which has a similar site config with fastcgi caching, and each is running WordPress.
Adding the config file for one of the vhosts, at the suggestion of @pennywise. I'm leaving my comments inline.
fastcgi_cache_path /etc/nginx/cache/vhostdomain levels=1:2 keys_zone=vhostdomain:100m inactive=60m;
server eot
Adding /etc/php5/fpm/pool.d/www.conf
sans comments:
[www]
user = www-data
group = www-data
listen = /var/run/php5-fpm.sock
listen.owner = www-data
listen.group = www-data
pm = dynamic
pm.max_children = 5
pm.start_servers = 2
pm.min_spare_servers = 1
pm.max_spare_servers = 3
chdir = /
ubuntu nginx php-fpm wordpress
ubuntu nginx php-fpm wordpress
edited Jul 4 '15 at 18:34
Andrew
asked Jul 3 '15 at 22:00
AndrewAndrew
62
62
You need to read your fpm logs. If nginx says unable to connect, fpm is going to be saying something more specific.
– AD7six
Jul 5 '15 at 5:59
add a comment |
You need to read your fpm logs. If nginx says unable to connect, fpm is going to be saying something more specific.
– AD7six
Jul 5 '15 at 5:59
You need to read your fpm logs. If nginx says unable to connect, fpm is going to be saying something more specific.
– AD7six
Jul 5 '15 at 5:59
You need to read your fpm logs. If nginx says unable to connect, fpm is going to be saying something more specific.
– AD7six
Jul 5 '15 at 5:59
add a comment |
1 Answer
1
active
oldest
votes
In your config you have two location blocks .php$
This is most probably the culprit, combine them in one and you should be fine.
Sometimes staring long time at code/config files makes your mind misses something obvious.
Thanks for catching that, @pennywise. I have, indeed, been staring at this for a while and missed that. I removed it. It's worth noting, though, that the duplicate detail doesn't exist in the vhosts, which are also seeing the issue.
– Andrew
Jul 3 '15 at 22:21
You can post these configs as well in the question. If you think there is not a problem with them, you might be under DoS. I recently had such a problem on a smaller DO VPS, but I use monit to monitor services and noticed. Check your logs for someone DoS-ing site around/before the time of the error.
– pennywise
Jul 3 '15 at 22:32
Thanks @pennywise. I just added the vhost config to the original question. I'd obviously never rule a DoS out of the question, but the odd thing is that it's intermittent, and nothing seems particularly odd in the log files. A big question that I'm trying to understand is, do my config settings seem reasonable, given the hardware? Perhaps the answer is just that I need to increase to a larger VPS. I just don't know.
– Andrew
Jul 3 '15 at 22:51
In general Nginx docs advise against usingif
, check this - wiki.nginx.org/IfIsEvil Also you might want to set up monitoring(if you don't already have), with something like munin, so if you have service like php5-fpm down, the daemon will bring it back. Other than that the question is pretty broad. Maybe posting and the php5-fpm will help if not to me, to someone else. It should be located in/etc/php5/fpm/pool.d/www.conf
– pennywise
Jul 4 '15 at 1:22
Thanks again, @pennywise. I've added the www.conf contents to the question. I removed the comments, in the interest of brevity.
– Andrew
Jul 4 '15 at 18:32
|
show 1 more comment
protected by Community♦ Jul 19 '17 at 7:34
Thank you for your interest in this question.
Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).
Would you like to answer one of these unanswered questions instead?
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
In your config you have two location blocks .php$
This is most probably the culprit, combine them in one and you should be fine.
Sometimes staring long time at code/config files makes your mind misses something obvious.
Thanks for catching that, @pennywise. I have, indeed, been staring at this for a while and missed that. I removed it. It's worth noting, though, that the duplicate detail doesn't exist in the vhosts, which are also seeing the issue.
– Andrew
Jul 3 '15 at 22:21
You can post these configs as well in the question. If you think there is not a problem with them, you might be under DoS. I recently had such a problem on a smaller DO VPS, but I use monit to monitor services and noticed. Check your logs for someone DoS-ing site around/before the time of the error.
– pennywise
Jul 3 '15 at 22:32
Thanks @pennywise. I just added the vhost config to the original question. I'd obviously never rule a DoS out of the question, but the odd thing is that it's intermittent, and nothing seems particularly odd in the log files. A big question that I'm trying to understand is, do my config settings seem reasonable, given the hardware? Perhaps the answer is just that I need to increase to a larger VPS. I just don't know.
– Andrew
Jul 3 '15 at 22:51
In general Nginx docs advise against usingif
, check this - wiki.nginx.org/IfIsEvil Also you might want to set up monitoring(if you don't already have), with something like munin, so if you have service like php5-fpm down, the daemon will bring it back. Other than that the question is pretty broad. Maybe posting and the php5-fpm will help if not to me, to someone else. It should be located in/etc/php5/fpm/pool.d/www.conf
– pennywise
Jul 4 '15 at 1:22
Thanks again, @pennywise. I've added the www.conf contents to the question. I removed the comments, in the interest of brevity.
– Andrew
Jul 4 '15 at 18:32
|
show 1 more comment
In your config you have two location blocks .php$
This is most probably the culprit, combine them in one and you should be fine.
Sometimes staring long time at code/config files makes your mind misses something obvious.
Thanks for catching that, @pennywise. I have, indeed, been staring at this for a while and missed that. I removed it. It's worth noting, though, that the duplicate detail doesn't exist in the vhosts, which are also seeing the issue.
– Andrew
Jul 3 '15 at 22:21
You can post these configs as well in the question. If you think there is not a problem with them, you might be under DoS. I recently had such a problem on a smaller DO VPS, but I use monit to monitor services and noticed. Check your logs for someone DoS-ing site around/before the time of the error.
– pennywise
Jul 3 '15 at 22:32
Thanks @pennywise. I just added the vhost config to the original question. I'd obviously never rule a DoS out of the question, but the odd thing is that it's intermittent, and nothing seems particularly odd in the log files. A big question that I'm trying to understand is, do my config settings seem reasonable, given the hardware? Perhaps the answer is just that I need to increase to a larger VPS. I just don't know.
– Andrew
Jul 3 '15 at 22:51
In general Nginx docs advise against usingif
, check this - wiki.nginx.org/IfIsEvil Also you might want to set up monitoring(if you don't already have), with something like munin, so if you have service like php5-fpm down, the daemon will bring it back. Other than that the question is pretty broad. Maybe posting and the php5-fpm will help if not to me, to someone else. It should be located in/etc/php5/fpm/pool.d/www.conf
– pennywise
Jul 4 '15 at 1:22
Thanks again, @pennywise. I've added the www.conf contents to the question. I removed the comments, in the interest of brevity.
– Andrew
Jul 4 '15 at 18:32
|
show 1 more comment
In your config you have two location blocks .php$
This is most probably the culprit, combine them in one and you should be fine.
Sometimes staring long time at code/config files makes your mind misses something obvious.
In your config you have two location blocks .php$
This is most probably the culprit, combine them in one and you should be fine.
Sometimes staring long time at code/config files makes your mind misses something obvious.
answered Jul 3 '15 at 22:10
pennywisepennywise
313
313
Thanks for catching that, @pennywise. I have, indeed, been staring at this for a while and missed that. I removed it. It's worth noting, though, that the duplicate detail doesn't exist in the vhosts, which are also seeing the issue.
– Andrew
Jul 3 '15 at 22:21
You can post these configs as well in the question. If you think there is not a problem with them, you might be under DoS. I recently had such a problem on a smaller DO VPS, but I use monit to monitor services and noticed. Check your logs for someone DoS-ing site around/before the time of the error.
– pennywise
Jul 3 '15 at 22:32
Thanks @pennywise. I just added the vhost config to the original question. I'd obviously never rule a DoS out of the question, but the odd thing is that it's intermittent, and nothing seems particularly odd in the log files. A big question that I'm trying to understand is, do my config settings seem reasonable, given the hardware? Perhaps the answer is just that I need to increase to a larger VPS. I just don't know.
– Andrew
Jul 3 '15 at 22:51
In general Nginx docs advise against usingif
, check this - wiki.nginx.org/IfIsEvil Also you might want to set up monitoring(if you don't already have), with something like munin, so if you have service like php5-fpm down, the daemon will bring it back. Other than that the question is pretty broad. Maybe posting and the php5-fpm will help if not to me, to someone else. It should be located in/etc/php5/fpm/pool.d/www.conf
– pennywise
Jul 4 '15 at 1:22
Thanks again, @pennywise. I've added the www.conf contents to the question. I removed the comments, in the interest of brevity.
– Andrew
Jul 4 '15 at 18:32
|
show 1 more comment
Thanks for catching that, @pennywise. I have, indeed, been staring at this for a while and missed that. I removed it. It's worth noting, though, that the duplicate detail doesn't exist in the vhosts, which are also seeing the issue.
– Andrew
Jul 3 '15 at 22:21
You can post these configs as well in the question. If you think there is not a problem with them, you might be under DoS. I recently had such a problem on a smaller DO VPS, but I use monit to monitor services and noticed. Check your logs for someone DoS-ing site around/before the time of the error.
– pennywise
Jul 3 '15 at 22:32
Thanks @pennywise. I just added the vhost config to the original question. I'd obviously never rule a DoS out of the question, but the odd thing is that it's intermittent, and nothing seems particularly odd in the log files. A big question that I'm trying to understand is, do my config settings seem reasonable, given the hardware? Perhaps the answer is just that I need to increase to a larger VPS. I just don't know.
– Andrew
Jul 3 '15 at 22:51
In general Nginx docs advise against usingif
, check this - wiki.nginx.org/IfIsEvil Also you might want to set up monitoring(if you don't already have), with something like munin, so if you have service like php5-fpm down, the daemon will bring it back. Other than that the question is pretty broad. Maybe posting and the php5-fpm will help if not to me, to someone else. It should be located in/etc/php5/fpm/pool.d/www.conf
– pennywise
Jul 4 '15 at 1:22
Thanks again, @pennywise. I've added the www.conf contents to the question. I removed the comments, in the interest of brevity.
– Andrew
Jul 4 '15 at 18:32
Thanks for catching that, @pennywise. I have, indeed, been staring at this for a while and missed that. I removed it. It's worth noting, though, that the duplicate detail doesn't exist in the vhosts, which are also seeing the issue.
– Andrew
Jul 3 '15 at 22:21
Thanks for catching that, @pennywise. I have, indeed, been staring at this for a while and missed that. I removed it. It's worth noting, though, that the duplicate detail doesn't exist in the vhosts, which are also seeing the issue.
– Andrew
Jul 3 '15 at 22:21
You can post these configs as well in the question. If you think there is not a problem with them, you might be under DoS. I recently had such a problem on a smaller DO VPS, but I use monit to monitor services and noticed. Check your logs for someone DoS-ing site around/before the time of the error.
– pennywise
Jul 3 '15 at 22:32
You can post these configs as well in the question. If you think there is not a problem with them, you might be under DoS. I recently had such a problem on a smaller DO VPS, but I use monit to monitor services and noticed. Check your logs for someone DoS-ing site around/before the time of the error.
– pennywise
Jul 3 '15 at 22:32
Thanks @pennywise. I just added the vhost config to the original question. I'd obviously never rule a DoS out of the question, but the odd thing is that it's intermittent, and nothing seems particularly odd in the log files. A big question that I'm trying to understand is, do my config settings seem reasonable, given the hardware? Perhaps the answer is just that I need to increase to a larger VPS. I just don't know.
– Andrew
Jul 3 '15 at 22:51
Thanks @pennywise. I just added the vhost config to the original question. I'd obviously never rule a DoS out of the question, but the odd thing is that it's intermittent, and nothing seems particularly odd in the log files. A big question that I'm trying to understand is, do my config settings seem reasonable, given the hardware? Perhaps the answer is just that I need to increase to a larger VPS. I just don't know.
– Andrew
Jul 3 '15 at 22:51
In general Nginx docs advise against using
if
, check this - wiki.nginx.org/IfIsEvil Also you might want to set up monitoring(if you don't already have), with something like munin, so if you have service like php5-fpm down, the daemon will bring it back. Other than that the question is pretty broad. Maybe posting and the php5-fpm will help if not to me, to someone else. It should be located in /etc/php5/fpm/pool.d/www.conf
– pennywise
Jul 4 '15 at 1:22
In general Nginx docs advise against using
if
, check this - wiki.nginx.org/IfIsEvil Also you might want to set up monitoring(if you don't already have), with something like munin, so if you have service like php5-fpm down, the daemon will bring it back. Other than that the question is pretty broad. Maybe posting and the php5-fpm will help if not to me, to someone else. It should be located in /etc/php5/fpm/pool.d/www.conf
– pennywise
Jul 4 '15 at 1:22
Thanks again, @pennywise. I've added the www.conf contents to the question. I removed the comments, in the interest of brevity.
– Andrew
Jul 4 '15 at 18:32
Thanks again, @pennywise. I've added the www.conf contents to the question. I removed the comments, in the interest of brevity.
– Andrew
Jul 4 '15 at 18:32
|
show 1 more comment
protected by Community♦ Jul 19 '17 at 7:34
Thank you for your interest in this question.
Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).
Would you like to answer one of these unanswered questions instead?
You need to read your fpm logs. If nginx says unable to connect, fpm is going to be saying something more specific.
– AD7six
Jul 5 '15 at 5:59