Nginx httpasswd for kirby panel

I just started using Kirby with Nginx and I’m having issues protecting the panel for my site…
I want to apply a authentication on the site panel… for some reason I am still able to access the panel with this configuration:

location /panel/ { auth_basic "Restricted"; auth_basic_user_file /etc/nginx/.htpasswd_kodu; }

any insight ?

I am no expert with Nginx but it looks like your rule only applies to /panel/ itself and not to URLs like /panel/login.

when panels/login dont works, maybe its a Problem whit your Configuration, Hope This is Helpfull For you