Hello
On a server driven by NGINX with PHP-FPM I'm trying to eliminate errors like
- 502 Bad Gateway
- recv() failed (104: Connection reset by peer) while reading response header from upstream, client: xx.xx.xx.xx, server: example.com, request: "GET / HTTP/1.1", upstream: "fastcgi://127.0.0.1:9017", host: "example.com"
- connect() failed (111: Connection refused) while connecting to upstream, client: xx.xx.xx.xx, server: example.com, request: "GET / HTTP/1.1", upstream: "fastcgi://127.0.0.1:9017", host: "example.com"
I have tried many configuration changes.
- added buffers
- stop using sockets (for Bad Gateway)...
I still have those errors and it's driving me crazy.
Here are my conf files :
Here is my /etc/nginx/nginx.conf
================================================================
user www-data;
worker_processes 4;
pid /var/run/nginx.pid;
events {
worker_connections 2048;
# multi_accept on;
}
http {
##
# Basic Settings
##
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 100;
client_max_body_size 10m;
client_header_timeout 1460;
client_body_timeout 1460;
types_hash_max_size 2048;
server_tokens off;
index index.php index.htm index.html redirect.php;
# server_names_hash_bucket_size 64;
# server_name_in_redirect off;
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_vary on;
gzip_proxied any;
gzip_comp_level 6;
gzip_buffers 16 8k;
gzip_http_version 1.1;
gzip_disable "MSIE [1-6].(?!.*SV1)";
gzip_types text/plain text/css application/json application/x-javascript text/xml
application/xml application/xml+rss text/javascript;
#FastCGI
fastcgi_intercept_errors on;
fastcgi_ignore_client_abort on;
fastcgi_buffers 256 16k;
fastcgi_buffer_size 32k;
fastcgi_connect_timeout 300;
fastcgi_read_timeout 300;
fastcgi_send_timeout 300;
fastcgi_index index.php;
#microcache
fastcgi_cache_path /var/cache/nginx2 levels=1:2 keys_zone=microcache:5m max_size=1000m;
log_format cache '$remote_addr - $remote_user [$time_local] "$request" '
'$status $upstream_cache_status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
limit_req_zone $binary_remote_addr zone=one:10m rate=1r/s;
include /etc/nginx/conf.d/*.conf;
include /etc/nginx/sites-enabled/*;
================================================================
Here is my /etc/nginx/sites-available/example.com.vhost
================================================================
server {
listen *:80;
server_name example.com ;
root /var/www/example.com/web;
index index.html index.htm index.php index.cgi index.pl index.xhtml;
..........
location @php {
try_files $uri =404;
include /etc/nginx/fastcgi_params;
fastcgi_pass 127.0.0.1:9017;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_intercept_errors on;
}
..........
================================================================
Here is my /etc/php5/fpm/pool.d/xxxxxx.conf relative to example.com
================================================================
[web8]
listen = 127.0.0.1:9017
listen.allowed_clients = 127.0.0.1
user = web8
group = client1
pm = dynamic
pm.max_children = 10
pm.start_servers = 2
pm.min_spare_servers = 1
pm.max_spare_servers = 5
pm.max_requests = 0
...............
================================================================
Please, do you see parameters that are wrong ?
Thank you by advance
On a server driven by NGINX with PHP-FPM I'm trying to eliminate errors like
- 502 Bad Gateway
- recv() failed (104: Connection reset by peer) while reading response header from upstream, client: xx.xx.xx.xx, server: example.com, request: "GET / HTTP/1.1", upstream: "fastcgi://127.0.0.1:9017", host: "example.com"
- connect() failed (111: Connection refused) while connecting to upstream, client: xx.xx.xx.xx, server: example.com, request: "GET / HTTP/1.1", upstream: "fastcgi://127.0.0.1:9017", host: "example.com"
I have tried many configuration changes.
- added buffers
- stop using sockets (for Bad Gateway)...
I still have those errors and it's driving me crazy.
Here are my conf files :
Here is my /etc/nginx/nginx.conf
================================================================
user www-data;
worker_processes 4;
pid /var/run/nginx.pid;
events {
worker_connections 2048;
# multi_accept on;
}
http {
##
# Basic Settings
##
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 100;
client_max_body_size 10m;
client_header_timeout 1460;
client_body_timeout 1460;
types_hash_max_size 2048;
server_tokens off;
index index.php index.htm index.html redirect.php;
# server_names_hash_bucket_size 64;
# server_name_in_redirect off;
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_vary on;
gzip_proxied any;
gzip_comp_level 6;
gzip_buffers 16 8k;
gzip_http_version 1.1;
gzip_disable "MSIE [1-6].(?!.*SV1)";
gzip_types text/plain text/css application/json application/x-javascript text/xml
application/xml application/xml+rss text/javascript;
#FastCGI
fastcgi_intercept_errors on;
fastcgi_ignore_client_abort on;
fastcgi_buffers 256 16k;
fastcgi_buffer_size 32k;
fastcgi_connect_timeout 300;
fastcgi_read_timeout 300;
fastcgi_send_timeout 300;
fastcgi_index index.php;
#microcache
fastcgi_cache_path /var/cache/nginx2 levels=1:2 keys_zone=microcache:5m max_size=1000m;
log_format cache '$remote_addr - $remote_user [$time_local] "$request" '
'$status $upstream_cache_status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
limit_req_zone $binary_remote_addr zone=one:10m rate=1r/s;
include /etc/nginx/conf.d/*.conf;
include /etc/nginx/sites-enabled/*;
================================================================
Here is my /etc/nginx/sites-available/example.com.vhost
================================================================
server {
listen *:80;
server_name example.com ;
root /var/www/example.com/web;
index index.html index.htm index.php index.cgi index.pl index.xhtml;
..........
location @php {
try_files $uri =404;
include /etc/nginx/fastcgi_params;
fastcgi_pass 127.0.0.1:9017;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_intercept_errors on;
}
..........
================================================================
Here is my /etc/php5/fpm/pool.d/xxxxxx.conf relative to example.com
================================================================
[web8]
listen = 127.0.0.1:9017
listen.allowed_clients = 127.0.0.1
user = web8
group = client1
pm = dynamic
pm.max_children = 10
pm.start_servers = 2
pm.min_spare_servers = 1
pm.max_spare_servers = 5
pm.max_requests = 0
...............
================================================================
Please, do you see parameters that are wrong ?
Thank you by advance