version: "2.3"
services:
ports-proxy:
image: nginx:latest
scale: 1
ipc: host
restart: always
volumes:
- ./nginx.conf:/etc/nginx/nginx.conf
ports:
- 10022:10022
- 13579:13579
- 13578:13578
user nginx;
worker_processes auto;
events {
worker_connections 1024;
}
stream {
upstream yjy {
hash $remote_addr consistent;
server 192.168.122.14:3389 weight=5 max_fails=1 fail_timeout=10s;
}
upstream xzp {
hash $remote_addr consistent;
server 192.168.122.170:3389 weight=5 max_fails=1 fail_timeout=10s;
}
upstream jzx_centos7 {
hash $remote_addr consistent;
server 192.168.122.200:22 weight=5 max_fails=1 fail_timeout=10s;
}
server {
listen 10022;
proxy_connect_timeout 1s;
proxy_timeout 3s;
proxy_pass jzx_centos7;
}
server {
listen 13579;
proxy_connect_timeout 1s;
proxy_timeout 3s;
proxy_pass yjy;
}
server {
listen 13578;
proxy_connect_timeout 1s;
proxy_timeout 3s;
proxy_pass xzp;
}
}
网友评论