代码

#不跳转源站
location / {
    #rewrite ^/(.*)$1 break;
    proxy_pass http://tv.lessh.cn/;
}

#跳转部分格式下的源站
location / {
    proxy_pass http://tv.lessh.cn;
    proxy_redirect off;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header X-Forwarded-Host $host;
}

#不跳转源站
location /{
    proxy_pass http://tv.lessh.cn;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header X-Forwarded-Host $host;
}

#类型过滤
location ~ .*\.(php|php5)?$
{
}

#类型缓存
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
{
    expires 30d;
}
Last modification:March 26th, 2020 at 11:03 pm
如果觉得我的文章对你有用,请随意赞赏