Skip to content

Commit 8525ca8

Browse files
committed
lua-resty-upstream-healthcheck 使用
1 parent e376462 commit 8525ca8

File tree

2 files changed

+11
-36
lines changed

2 files changed

+11
-36
lines changed
Loading

README.md

Lines changed: 11 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -776,44 +776,17 @@
776776
proxy_pass http://tomcat;
777777
}
778778

779-
# status page for all the peers:
780779
location /server/status {
781-
access_log off;
782-
allow 127.0.0.1;
783-
784-
default_type text/plain;
785-
content_by_lua_block {
786-
local hc = require "resty.upstream.healthcheck"
787-
ngx.say("Nginx Worker PID: ", ngx.worker.pid())
788-
ngx.print(hc.status_page())
789-
}
790-
}
791-
792-
# status page for all the peers:
793-
location /lua {
794-
default_type 'text/html';
795-
lua_code_cache off;
796-
content_by_lua_file /home/tinywan/Openresty_Protect/First_Protect/lua/test.lua;
797-
}
798-
799-
location /lua_get_redis {
800-
default_type 'text/html';
801-
lua_code_cache off;
802-
content_by_lua_file /home/tinywan/Openresty_Protect/First_Protect/lua/get_redis.lua;
803-
}
804-
805-
location /get_redis_iresty {
806-
default_type 'text/html';
807-
lua_code_cache off;
808-
content_by_lua_file /home/tinywan/Openresty_Protect/First_Protect/lua/get_redis_iresty.lua;
809-
}
810-
811-
location /get_main {
812-
default_type 'text/html';
813-
lua_code_cache off;
814-
content_by_lua_file /home/tinywan/Openresty_Protect/First_Protect/lua/main.lua;
780+
access_log off;
781+
allow 127.0.0.1;
782+
783+
default_type text/plain;
784+
content_by_lua_block {
785+
local hc = require "resty.upstream.healthcheck"
786+
ngx.say("Nginx Worker PID: ", ngx.worker.pid())
787+
ngx.print(hc.status_page())
788+
}
815789
}
816-
817790
}
818791

819792
server {
@@ -869,6 +842,8 @@
869842
}
870843

871844
```
845+
+ 状态查看,通过访问:`http://127.0.0.1/server/status`
846+
![Markdown](https://github.com/Tinywan/Lua-Nginx-Redis/blob/master/Images/Openresty_lua-resty-upstream-healthcheck.png)
872847
### Redis、Lua、Nginx一起工作事迹
873848
+ 解决一个set_by_lua $sum 命令受上下文限制的解决思路,已完美解决
874849
+ - [x] [API disabled in the context of set_by_lua](https://github.com/openresty/lua-nginx-module/issues/275)

0 commit comments

Comments
 (0)