nginx 转发到 域名

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/u014595375/article/details/84840350

需求:
转发 a.domain.com/aaab.domain.com/aaa

则在a.domain.com机器上配置nginx conf,如下

    location ~* (aaa) {
        resolver 114.114.114.114 valid=3600s;
        resolver_timeout 3s;
        set $ola "b.domain.com";

        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_pass http://$ola;
    }

猜你喜欢

转载自blog.csdn.net/u014595375/article/details/84840350
今日推荐