nginx代理和负载均衡
nginx四层代理
stream {
#8900 端口将以4层TCP协议方式转发至后端app_sever;
server {
listen 8900;
proxy_pass app_server;
}
#代理
upstream app_server{
server 192.31.10.120:8920;
}
#代理socket
server {
listen 9301;
proxy_pass socket_server;
}
upstream socket_server{
server 192.31.10.120:8910; #发布socket服务端
}
#代理FTP
server {
listen 8666;
proxy_pass ftp_server;
}
upstream ftp_server{
server 192.31.10.120:18930; #FTP默认是21端口,
}
}
nginx四层负责均衡