Je continue à expérimenter les location.
J’ai un soucis :
Lorsque je tente de mettre ceci dans le fichier security :
# block the country
location ~* /(sso|admin|login) {
if ($allowed_country = no) {
return 444;
}
}
Voilà le résultat que j’'obtiens avec un pays autorisé en cherchant à me logguer sur une appli (ici Gitea) :
xxx.xxx.xxx.xxx - - [13/Mar/2022:15:49:14 +0100] "GET /gitea/user/login HTTP/2.0" 404 162 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:98.0) Gecko/20100101 Firefox/98.0"
xxx.xxx.xxx.xxx - - [13/Mar/2022:15:49:14 +0100] "GET /favicon.ico HTTP/2.0" 302 154 "https://xxx.noho.st/gitea/user/login" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:98.0) Gecko/20100101 Firefox/98.0"
xxx.xxx.xxx.xxx - - [13/Mar/2022:15:49:14 +0100] "GET /yunohost/sso/?r=aHR0cHM6Ly9jaGF0b24ubm9oby5zdC9mYXZpY29uLmljbw== HTTP/2.0" 200 3120 "https://xxx.noho.st/gitea/user/login" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:98.0) Gecko/20100101 Firefox/98.0"
Une belle erreur 404.
On dirait qu’il y a un appel/une redirection vers le portail du serveur à la fin (/yunohost/sso
).
Note : pas de soucis pour me logguer directement sur le serveur (réponse 200) :
xxx.xxx.xxx.xxx - - [13/Mar/2022:15:56:12 +0100] "GET /yunohost/sso/?r=aHR0cHM6Ly9jaGF0b24ubm9oby5zdC8= HTTP/2.0" 200 3022 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:98.0) Gecko/20100101 Firefox/98.0"
xxx.xxx.xxx.xxx - - [13/Mar/2022:15:56:12 +0100] "GET /yunohost/sso/assets/js/ynh_portal.js HTTP/2.0" 200 14013 "https://xxx.noho.st/yunohost/sso/?r=aHR0cHM6Ly9jaGF0b24ubm9oby5zdC8=" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:98.0) Gecko/20100101 Firefox/98.0"
xxx.xxx.xxx.xxx - - [13/Mar/2022:15:56:12 +0100] "GET /yunohost/sso/assets/themes/xxx/custom_portal.js HTTP/2.0" 200 1436 "https://xxx.noho.st/yunohost/sso/?r=aHR0cHM6Ly9jaGF0b24ubm9oby5zdC8=" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:98.0) Gecko/20100101 Firefox/98.0"