美文网首页
nginx 代理

nginx 代理

作者: Joncc | 来源:发表于2022-03-07 14:13 被阅读0次
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;
    }
}

相关文章

网友评论

      本文标题:nginx 代理

      本文链接:https://www.haomeiwen.com/subject/iwbifrtx.html