使用curl localhost:……向nginx发送消息
nginx中有如下配置:
upstream backend_push {
server 0.0.0.0;
balancer_by_lua_file lua/upstream_push.lua;
keepalive 100;
}
location中头域配置:
|
配置
|
头域
|
|
proxy_set_header Host $host;
|
Host: localhost
|
|
proxy_set_header Host $proxy_host;
|
Host: backend_push
|
本文介绍如何通过curl命令向配置了Lua脚本的nginx后端推送消息。详细展示了nginx的upstream配置,包括使用Lua脚本进行负载均衡,并在location块中设置proxy_set_header来传递Host头部信息。
493

被折叠的 条评论
为什么被折叠?



