-
I'm trying to block access by ip but this doesn't work, this is my configuration: `
} Request a username and password: works Maybe I'm doing something wrong or the configuration is being overwritten, can someone guide me please. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
You want to have basic auth + allow list? Both conditions needs to be true? I think you need to look in the satisfy directive. |
Beta Was this translation helpful? Give feedback.
Thanks for your answer, it guides me a lot.
Yes, I need both conditions to be met, the way to achieve it was the following
The /etc/nginx/vhost.d/site.com file should only have this:
And to request a password, just create it with htpasswd -c /etc/nginx/htpasswd/site.com, it is not necessary to add conf lines in the previous conf file (vhost.d/site.com), it is important that the names of the configuration files are named like the site (site.com) and not end in .conf
With this the configuration will be added to the main file that is regenerated every time nginx is restarted /etc/nginx/conf.d/default.conf an…