Nginx负载均衡多节点静态资源转发(单节点没有资源)处理

来源:互联网 发布:流体力学 知乎 编辑:程序博客网 时间:2024/06/06 17:43

nginx0(192.168.1.1) nginx1(192.168.1.2) nginx2(192.168.1.3)

nginx0 访问入口 外网访问 http://192.168.1.1/audioPath/hzy/ssh/1111.wav

upstream /audioPath/{
nginx1:80;
}


nginx1配置(192.168.1.2):

        location /hzy/ {            add_header Access-Control-Allow-Origin *;        root /;        if (!-f $request_filename){        rewrite ^/(.*)$ http://192.168.1.3/$1 redirect;        }    }
阅读全文
0 0
原创粉丝点击