#PROXY-START/
location ^~ /
{
proxy_pass https://xxxxx.com;
proxy_set_header Host 1xxxxx.com;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header REMOTE-HOST $remote_addr;
add_header X-Cache $upstream_cache_status;
#Set Nginx Cache
set $static_fileypUIidHp 0;
if ( $uri ~* "\.(gif|png|jpg|css|js|woff|woff2)$" )
{
set $static_fileypUIidHp 1;
expires 12h;
}
if ( $static_fileypUIidHp = 0 )
{
add_header Cache-Control no-cache;
}
}
#PROXY-END/
一个小问题,假设目标网址为【 2.com/tu/1.jpg 】,这里面的 /tu/ 怎么替换? 想实现用网址 1.com/123/1.jpg 反代 2.com/tu/1.jpg .
百度了好多参数,但不知道咋替换宝塔的配置,所以想着不如来咨询下大神们啦大神摸鱼时,带带我这个小问题吧?
|
|