This is driving me mad, hopefully someone can help. I have the following warning: But the 403 page is not friendly to blocked countries, I want to redirect people who are blocked to a custom 403 page.
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;
}
}
My custom file lives in /var/www/sitename/403/index.html. I have tried numerous suggestions but non have worked :(
Try this changes to your configuration: