打开APP
userphoto
未登录

开通VIP,畅享免费电子书等14项超值服

开通VIP
多IP服务器 Nginx 代理udp并绑定来源IP

#user  nobody;
worker_processes  1;

#error_log  logs/error.log;
#error_log  logs/error.log  notice;
#error_log  logs/error.log  info;

#pid        logs/nginx.pid;


events {
    worker_connections  1024;
}


stream {


        upstream radius1812 {
                #server 172.42.1.10:1812;
                #server 172.42.1.21:1812;
                server 172.52.1.21:1812;
        }

        upstream radius1813 {
                #server 172.42.1.10:1813;
                #server 172.42.1.21:1813;
                server 172.52.1.21:1813;

        }

        server {
                listen 1812 udp;
                
proxy_bind 172.52.1.25;#绑定来源IP
                proxy_responses 1;
                proxy_timeout 20s;
                proxy_pass radius1812;
        }


        server {
                listen 1813 udp;
                proxy_bind 172.52.1.25;
                proxy_responses 1;
                proxy_timeout 20s;
                proxy_pass radius1813;
        }



        upstream ac2000 {
                #server 172.30.253.1:2000;
                server 192.168.100.5:2000;

        }

        upstream ac50100 {
                #server 172.30.253.1:50100;
                server 192.168.100.5:50100;

        }

        server {
                listen 2000 udp;
                proxy_bind 172.52.1.25;
                proxy_responses 1;
                proxy_timeout 20s;
                proxy_pass ac2000;
        }


        server {
                listen 50100 udp;
                proxy_bind 172.52.1.25;
                proxy_responses 1;
                proxy_timeout 20s;
                proxy_pass ac50100;
        }




}




http {
    include       mime.types;
    default_type  application/octet-stream;

    #log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
    #                  '$status $body_bytes_sent "$http_referer" '
    #                  '"$http_user_agent" "$http_x_forwarded_for"';

    #access_log  logs/access.log  main;

    sendfile        on;
    #tcp_nopush     on;

    #keepalive_timeout  0;
    keepalive_timeout  65;

    #gzip  on;


    upstream portalserver {

        server 172.42.1.15:8080;
        server 172.42.1.16:8080;

    } 

    upstream yunserver {

        server 123.207.110.98:8080;

    }
    
    server {
        listen       80;
        server_name  localhost;

        #charset koi8-r;

        #access_log  logs/host.access.log  main;

        location / {

            root   html;
            index  index.html index.htm;
            proxy_pass   http://portalserver;

        }


        
    }


    # another virtual host using mix of IP-, name-, and port-based configuration
    #
    server {
        listen       8080;

        location / {
            root   html;
            index  index.html index.htm;
            proxy_pass   http://portalserver;
        }
    }


    # HTTPS server
    #
    #server {
    #    listen       443 ssl;
    #    server_name  localhost;

    #    ssl_certificate      cert.pem;
    #    ssl_certificate_key  cert.key;

    #    ssl_session_cache    shared:SSL:1m;
    #    ssl_session_timeout  5m;

    #    ssl_ciphers  HIGH:!aNULL:!MD5;
    #    ssl_prefer_server_ciphers  on;

    #    location / {
    #        root   html;
    #        index  index.html index.htm;
    #    }
    #}

}

本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请点击举报
打开APP,阅读全文并永久保存 查看更多类似文章
猜你喜欢
类似文章
nginx+tomcat负载均衡策略
Nginx安装配置详解(转)
Nginx 记录请求分发日志设置
CentOS下yum安装 Nginx
nginx?根据?短链接?分发跳转服务器
PHP常用的缓存技术汇总
更多类似文章 >>
生活服务
热点新闻
分享 收藏 导长图 关注 下载文章
绑定账号成功
后续可登录账号畅享VIP特权!
如果VIP功能使用有故障,
可点击这里联系客服!

联系客服