Hello,
现在我这里nginx作为proxy要通过http, uwsgi和fastcgi和后端通信,按照春哥的例子,目前实现http的动态upstream没有问题。
worker_processes 1;
error_log logs/error.log info;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;
lua_package_path 'lua/lua-resty-http/lib/?.lua;lua/?.lua;;';
init_worker_by_lua_file lua/containers.lua;
upstream backend {
server 0.0.0.1; # just an invalid address as a place holder
balancer_by_lua_file lua/balancer.lua; # balancing policy
keepalive 65; # connection pool
}
server {
listen 8080;
location / {
}
}
server {
listen 8081;
location / {
content_by_lua_file lua/content.lua;
}
}
}
可是我如何根据请求的信息(Host和URI)来决定该用何种协议和后端通信呢,而不仅仅是proxy_pass?
Thanks