nginx

IP filtering protection on the login page with NGINX

If there is no other users that login on your websites but your team, you may want to filter the IP that can access the login pages.

On NGINX, this is done by adding location rules in your server block:

    
server {
    ...

    #login protection
    location /user/login {
        allow 92.127.254.0/24; #Domain
        allow 191.40.194.126; #IP
        try_files $uri /index.php?$query_string;
    }
    .....
    
}