Hello,
I found this on the internet:
Using CloudFlare for country blocking - Nginx Library
and wondering if this can be put in the additional nginx directive on GUI that way?:
EDIT: I have tested it in directive on GUI:
Ungültige nginx-Konfiguration: nginx: [emerg] "map" directive is not allowed here
so it don't work there where can i put them (update safe)? maybe /etc/nginx/conf.d/ ?
EDIT2: I think that this part can be placed (update-safe) under /etc/nginx/conf.d/:
And this in additional nginx directive in GUI:
Right?
Thanks in advance.
I found this on the internet:
Using CloudFlare for country blocking - Nginx Library
and wondering if this can be put in the additional nginx directive on GUI that way?:
Code:
map $http_cf_ipcountry $allow {
default yes;
CN no;
MX no;
NO no;
}
if ($allow = no) {
return 403;
}
EDIT: I have tested it in directive on GUI:
Ungültige nginx-Konfiguration: nginx: [emerg] "map" directive is not allowed here
so it don't work there where can i put them (update safe)? maybe /etc/nginx/conf.d/ ?
EDIT2: I think that this part can be placed (update-safe) under /etc/nginx/conf.d/:
Code:
map $http_cf_ipcountry $allow {
default yes;
CN no;
MX no;
NO no;
}
And this in additional nginx directive in GUI:
Code:
if ($allow = no) {
return 403;
}
Right?
Thanks in advance.
Last edited: