我运行一个drupal 7应用程序(3backends),我有3个清漆服务器不断拒绝提取后端。 我在这里读了很多类似的错误,但仍然无法解决我的问题,扔503清漆取得失败的上师冥想。 我已经阅读所有的post,所有似乎都build议高超时,我已经设置为600s,许多不build议.probe,我有round.robin(切换后端),这里是我的后端configuration:
backend project1 { .host = "myhost.ip"; .port = "80"; .connect_timeout = 600s; .first_byte_timeout = 600s; .probe = { .timeout = 600s; .interval = 10s; .window = 5; .threshold = 2; .request = "GET HTTP/1.1" "Host: example.com" "Connection: close"; } }
我已经监视了我的错误日志和访问日志,顺便说一下,我注意到我有太多这样的错误,但我不希望你有偏见。
[info] Client prematurely closed connection (broken pipe)
有时
reqv failed
作为一个旁注,我想提及,所以我有fast-cgi错误仍在进行,但我不认为它与我的清漆错误有关系:
Primary Script unknown ......, fastcgi, upstream:127.0.0.1
我通过fast-cgi运行nginx + php-fpm。 我真的不确定,什么configuration清漆期望从后端,使其拒绝获取它,
发生错误的nginxconfiguration给了我这个错误之前,所以这里是我的nginxconfiguration:
user nginx nginx; worker_processes 4; error_log /var/log/nginx/error.log info; events { worker_connections 8192; multi_accept on; use epoll; } worker_rlimit_nofile 64000; http { include /etc/nginx/mime.types; default_type application/octet-stream; log_format main '$remote_addr - $remote_user [$time_local] ' '"$request" $status $bytes_sent ' '"$http_referer" "$http_user_agent" '; client_header_timeout 10m; client_max_body_size 100m; client_body_timeout 10m; send_timeout 10m; client_body_buffer_size 3m; connection_pool_size 256; client_header_buffer_size 1k; large_client_header_buffers 4 2k; request_pool_size 32k; gzip on; gzip_vary on; gzip_disable "MSIE [1-6]\."; gzip_min_length 10240; gzip_proxied expired no-cache no-store private auth; gzip_types text/plain application/xml; open_file_cache max=2000 inactive=20s; open_file_cache_valid 60s; open_file_cache_min_uses 5; open_file_cache_errors off; output_buffers 1 32k; postpone_output 1460; sendfile on; tcp_nopush on; tcp_nodelay on; fastcgi_send_timeout 1800; fastcgi_read_timeout 1800; fastcgi_connect_timeout 1800; fastcgi_ignore_client_abort on; keepalive_timeout 75 20; ignore_invalid_headers on; index index.html; server { listen 80; server_name example.com; rewrite ^(.*) http://example.com$1 permanent; } server { listen 80; server_name www.example.com; access_log /var/log/nginx/access.log main; error_log /var/log/nginx/error.log info; root /var/www/public; index index.php index.phtml index.html; autoindex on; gzip_types text/plain text/css application/json application/x-ja vascript text/xml application/xml application/xml+rss text/javascript applicatio n/javascript; location ~ \..*/*\.php$ { return 403; } location ~^/sites/.*/private/{ return 403; } location ~^/sites/.*/files/* { try_files $uri @rewrite; } location ~ (^|/)\. { return 403; } location / { try_files $uri @rewrite; } location @rewrite { rewrite ^ /index.php; } location ~ \.php$ { try_files $uri @rewrite; #fastcgi_pass unix:/var/run/php5-fpm.sock; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_buffer_size 128k; fastcgi_buffers 256 16k; fastcgi_busy_buffers_size 256k; fastcgi_temp_file_write_size 256k; fastcgi_keep_conn off; include /etc/nginx/fastcgi_params; } location ~* \.(jpg|jpeg|css|gif|png|js|ico|xml)$ { try_files $uri $uri/ ; access_log off; log_not_found off; expires 30d; } }
有人能指点我哪个方向来debugging这个问题吗? 我很可能确定,pb是在我的后端,而不是我的清漆,但不确定,为什么网站有时加载,有时会抛出一个直/ awfull“后端获取失败503 – 大师冥想”。 感谢您的宝贵帮助。
更新:
修复是禁用gzip。 我有一个空的内容和主页上的redirect,所以,gzip + header-content-length = 0(空)触发了一个红色的标志清漆,清漆标记为不健康压缩的东西大小为0.错误的标题。 禁用gzip或返回一些内容到服务器响应将解决这个问题
在您的.request您似乎没有指定文档。 因此,我认为它是试图加载你的整个Drupal站点作为探针。 您可以将其更改为:
"GET /sitehealth.html HTTP/1.1"
sitehealth.html只是一个简单的文本文件,探针可以加载。
进一步的故障排除,你可以完全禁用探头,看看是否有所作为? 直接点击网站时是否遇到任何错误,而无需通过caching?
基本上,得到可靠工作的最简单的configuration,然后添加一个你的附加function,直到你打破的东西。