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; #Domain
        allow; #IP
        try_files $uri /index.php?$query_string;