当前位置:网站首页>Varnish 503 no backend connection – varnish health check
Varnish 503 no backend connection – varnish health check
2022-06-29 20:59:00 【Brother Xing plays with the clouds】
varnish It will appear after a period of time after opening 503 error , Direct access to the backend OK, front end ping Back end OK, as a result of varnish Judge that the back end has hung up , Refuse request . In the configuration backend when , Configured with .prob, The configuration is as follows :
.probe= { .url = "/"; .timeout = 1s; .interval = 10m; .window = 10; .threshold = 8; .expected_response = 200; } Back end :nginx,php,yii frame ,url rewrite The request is forwarded to the backend "/" On , after yii route , The last request address is /site/index, That is, request SiteController Medium actionIndex, I haven't joined in the project yet SiteController, So back end to front end 404, And .expected_response = 200 atypism , When varnish After several retries, it will be judged that the backend is hung . Therefore, it is recommended to add a varnish Special test files , Such as .probe= { .url = "/varnishTest"; .timeout = 1s; .interval = 10m; .window = 10; .threshold = 8; .expected_response = 200; } When varnish It will be requested when it is detected /varnishTest, after yii route , Get the requested address /varnishTest/index, It will return to 200, The problem is solved . To prevent users from directly accessing varnish Dedicated test address , Can be in varnish Add... To the request set req.http.FromVarnish = "yes";, That is to say header Add a variable to , stay PHP Medium test <?php if ( isset($_SERVER['FromVarnish']) && $_SERVER['FromVarnish'] === 'yes' ){ echo 'yes'; }else { header("HTTP/1.1 404 Not Found");exit; }
边栏推荐
- Topic39——78. subset
- CORDIC based Signal Processor desgn
- 项目中退出操作
- Recommended books -- walking in the daytime and at night
- How to evaluate iFLYTEK AI translation pen P20 series? Is it worth buying?
- 如何评价科大讯飞AI翻译笔P20系列,值得买吗?
- Chainsafe cross chain bridge deployment tutorial
- How can colleges and universities build future oriented smart campus based on cloud native? Full stack cloud native vs traditional technology architecture
- [fishing artifact] code tool for lowering the seconds of UI Library -- form part (I) design
- Topic39——78. 子集
猜你喜欢

High energy live broadcast, a gathering of celebrities! We invite you to explore bizdevops.

「运维有小邓」Active Directory批量用户创建

广东二级造价工程师《造价管理》真题解析

Information system project manager -- Chapter VII examination questions of project cost management over the years

Detailed description of gaussdb (DWS) complex and diverse resource load management methods

Uncover the secret! Pay attention to those machines under the membership system!

verilog实现DDS波形发生器模块,可实现频率、相位可调,三种波形

At least 3 years for learning amplifier?

A Japanese Cherry sold at a sky high price of 1980 yuan. Netizen: I feel cheated after eating it

leetcode:238. Product of arrays other than itself
随机推荐
Selection of materials for space conductive disc slip ring
Shutter bottomnavigationbar toggle page hold
About Effect Size
VHDL电话计费系统设计
Reinforcement learning weekly (issue 51): integration of PAC, ilql, RRL & model free reinforcement learning into micro grid control: overview and Enlightenment
量子机器学习的基础和应用:一个简明文献综述
Chainsafe cross chain bridge deployment tutorial
LSF-bsub命令
【云原生实战】KubeSphere实战——多租户系统实战
[cloud native practice] kubesphere practice - Multi tenant system practice
My creation anniversary
"Xiaodeng" active directory batch user creation in operation and maintenance
导航 习题【微机原理】【习题】
"Xiaodeng" in operation and maintenance monitors user login operations in real time
leetcode:307. 区域和检索 - 数组可修改
路由汇总带来的三层环路-解决实验
The reason why the log analysis tool of "operation and maintenance" is used more and more frequently
Topic39——78. 子集
ads131a04 ADC verilog实现及仿真
Shell implementation of Memcache cache cache hit rate monitoring script