1. 程式人生 > >Tengine2.2.2 健康檢查http1.1 伺服器報錯400 Bad Request 問題分析

Tengine2.2.2 健康檢查http1.1 伺服器報錯400 Bad Request 問題分析

Tengine2.2.2官方健康檢查示例

check interval=3000 rise=2 fall=5 timeout=1000 type=http;
check_keepalive_requests 100;
check_http_send "HEAD / HTTP/1.1\r\nConnection: keep-alive\r\n\r\n";
check_http_expect_alive http_2xx http_3xx;

結果一直報錯,通過抓包工具發現伺服器端返回400 Bad Request

查詢http1.1協議發現請求當中必須包含host請求頭,(其值可以為空),否則伺服器會返回400 Bad Request錯誤

A client MUST include a Host header field in all HTTP/1.1 request messages . If the requested URI does not include an Internet host name for the service being requested, then the Host header field MUST be given with an empty value. An HTTP/1.1 proxy MUST ensure that any request message it forwards does contain an appropriate Host header field that identifies the service being requested by the proxy. All Internet-based HTTP/1.1 servers MUST respond with a 400 (Bad Request) status code to any HTTP/1.1 request message which lacks a Host header field.

我修改後的示例

check interval=3000 rise=2 fall=5 timeout=2000 type=http;
check_keepalive_requests 100;
check_http_send "GET / HTTP/1.1\r\nHost:\r\nConnection: keep-alive\r\n\r\n";
check_http_expect_alive http_2xx http_3xx;

其中加上了host請求頭,值可以為空。

測試無誤,nginx與tomcat使用http1.1長連線進行健康檢查.

有個配置check_shm_size size

所有的後端伺服器健康檢查狀態都存於共享記憶體中,該指令可以設定共享記憶體的大小。預設是1M,如果你有1千臺以上的伺服器並在配置的時候出現了錯誤,就可能需要擴大該記憶體的大小。

相關推薦

Tengine2.2.2 健康檢查http1.1 伺服器400 Bad Request 問題分析

Tengine2.2.2官方健康檢查示例 check interval=3000 rise=2 fall=5 timeout=1000 type=http; check_keepalive_requests 100; check_http_send "HEAD / HTTP

解決 You are using pip version 7.1.2, however version 18.0 is available.

完美 bsp -- 安裝目錄 方法 exe win .exe 嘗試 Windows下安裝 Pyhton的mysql庫時 命令行一直報 You are using pip version 7.1.2, however version 18.0 is available

記一次 centos7.2 rpm方式安裝mysql5.7.19

assume bzip with mysql oot -s first minimal enter 0、環境 本文操作系統: CentOS 7.2.1511 x86_64 MySQL 版本: 5.7.19 安裝之前先把開發環境裝一下 yum -y install

git(2)======== 連接倉庫後提交

war fatal ref details repo caused date 目錄 rst 在共享完成密鑰後出現如下情況 [root@python3_ansible python]# git push -u origin master Username for ‘htt

ryu學習筆記(2) 之 ryu-manager運行

.com 其他 nbsp -i OS in use 分配 art -s http://blog.csdn.net/haimianxiaojie/article/details/48769653 ryu在使用的時候最常出現的報錯是:address already in

asp.net core 2.0釋出到IIS流程及解決方案

  我這是個新裝的伺服器,沒有安裝任何軟體。 一、釋出流程 1.安裝AspNetCoreModule託管模組,同時會自動安裝..net core runtime DotNetCore.2.0.8-WindowsHosting.exe https://docs.microsoft.

eclipse升級Android SDK Tool版本到25.2.5後運行項目Unable to build: the file dx.jar was not loaded from the SDK folder

com 但是 概述 details bsp 更新 href unable 解決辦法 概述 由於最近通過SDK-Manager更新了build-tools,當要用到dx.jar這個包時,自動調用最新版本Android SDK build-tools中dx.jar,但是運行a

解決 Failed to execute goal plugins:maven-clean-plugin:2.5:clean (default-clean) on project

在用maven的Tomcat外掛啟動專案時經常出現這個錯誤  Failed to execute goal org.apache.maven.plugins:maven-clean-plugin:2.5:clean (default-clean) on project。看一下上次專案是

centos7.2 網絡卡啟動不了 Failed to start LSB: Bring up/down

虛擬機器一段時間不用突然不能上網了,具體報錯如下: /etc/init.d/network restart Restarting network (via systemctl):  Job for network.service failed because the

解決 dubbo-admin版本是2.5.4-SNAPSHOT 在jdk8執行的方法

1、webx的依賴改為3.1.6版; <dependency> <groupId>com.alibaba.citrus</groupId> <artifactId>citrus-web

spark-2.4.3-bin-without-hadoop 啟動 failed to launch: nice -n 0

錯誤日誌 [root@xy01 spark-2.4.3-bin-without-hadoop]# ./sbin/start-mas

Android studio出現Error:Unable to tunnel through proxy. Proxy returns "HTTP/1.1 400 Bad Request"的解決辦法

tar iss returns 圖片 height proxy alt req turn 最近更新了一下Android Studio(下文簡寫成AS),然後打開工程發現出現Error:Unable to tunnel through proxy. Proxy returns

從svn檢查為項目,需要改的幾個地方

log4 bsp onf 選中 prop 地方 figure 需要 time 1.選中項目,右鍵--->build path--->configure build path 2.添加library Library--->add Library---&g

Android API 28 使用 android-async-http1.4.8

專案升級 API 28後,使用 android-async-http1.4.8 時,報錯如下: java.lang.NoClassDefFoundError: Failed resolution of: Lorg/apache/commons/logging/LogFactory;

bad substitution ……Container exited with a non-zero exit code 1

執行Spark任務報錯 18/10/10 19:42:57 WARN YarnSchedulerBackend$YarnSchedulerEndpoint: Container marked as failed: container_1538070068357_0019_02_000

啟用auto_position=1一直

啟用auto_position=1一直報錯 Got fatal error 1236 from master when reading data from binary log: 'The slave is connecting using CHANGE MASTER TO MASTER_AUTO_P

Appium 1.9.1 啟動 Fatal TypeError: Class constructor BaseDriver cannot be invoked without 'new'

安裝了appium 1.9.1後一直報錯Fatal TypeError: Class constructor BaseDriver cannot be invoked without 'new',無法啟動,解除安裝後安裝1.8.1可以正常使用了。 npm install -g cnpm --regis

稅控伺服器

發票上傳報錯: pool-167-thread-1  2018-11-12 17:00:23.433  DEBUG (SSLTransfer.java:147) - 訪問URL:https://118.112.187.42:7001/acceptFramework/UniAcceptSe

secureCRT連線伺服器:Unable to authenticate

用secureCRT連線遠端伺服器時報錯: 1 The client has disconnected from the server.Reason: 2 Unable to authenticate using any of the configured authentication methods

編譯安卓7.1原始碼 ninja: build stopped: subcommand----解決辦法

編譯過程中出錯: ninja: build stopped: subcommand failed .build/core/ninja.mk:148: recipe for target ‘ninja_wrapper’ failed make: *** [ninja_wrapper] Er