这让我很生气,希望有人可以提供帮助。我有以下警告:But the 403 page is not friendly to blocked countries
,我想将被阻止的人重定向到自定义 403 页面。
map $geoip2_data_country_code $allowed_country {
default no;
AU yes;
CA yes;
GB yes;
NZ yes;
US yes;
}
server {
location / {
if ($allowed_country = no) {
return 403;
}
index index.php index.html;
try_files $uri $uri/ /index.php?$args;
}
}
我的自定义文件位于/var/www/sitename/403/index.html
. 我尝试了很多建议,但没有奏效:(