2 jiansva jiansva 于 2017.09.04 18:42 提问

求助nginx中的location配置问题 1C

server{
listen 84;
server_name _;
root /data/www/myweb/ts;
access_log /data/nginx_log/access.log access;

location ~ ^/(.*).ts$ {
    add_header Cache-Flag hit;
    try_files /$uri @tsvideo;
    try_files /$uri @tsvideo_new;
}

location @tsvideo {
    add_header Cache-Flag miss;
    proxy_store on;
    proxy_temp_path /data/www/myweb/ts;
    proxy_store_access user:rw group:rw all:rw;
    proxy_set_header Host v1.abc.com
    proxy_pass http://v1.abc.com
}

location @tsvideo_new {
    add_header Cache-Flag miss;
    proxy_store on;
    proxy_temp_path /data/www/myweb/ts;
    proxy_store_access user:rw group:rw all:rw;
    proxy_set_header Host v12.abc.com
    proxy_pass http://v12.abc.com
}

}

请问下如何修改成当访问v1.abc.com,指向的是@tsvideo,访问v12.abc.com指向的是
@tsvide_new

Csdn user default icon
上传中...
上传图片
插入图片