我将流量重定向到我的网站,对于某些国家/地区:
if ($http_cf_ipcountry != "UK") {
return 301 https://int.xyz.com;
}
现在,如果请求uri指向特定位置,我如何授予用户访问网站的权限?例如跟随但在nginx中的东西:
if ($http_cf_ipcountry != "UK" && !contains($uri, "/resource/image/")) {
return 301 https://int.xyz.com;
}
答案 0 :(得分:0)
您可以使用location
块:
location /resource/image/ {
...
}
location / {
if ($http_cf_ipcountry != "UK") {
return 301 https://int.xyz.com;
}
...
}
有关详细信息,请参阅this document。