How can restrict access to kibana using nginx

hi all,
I install nginx to have authentication page in order to accessing a site (KIBANA console). for this purpose, i write following in /etc/nginx/conf.d/default.conf file

server {
listen *:80;
server_name _;
location / {
auth_basic "Restricted";
auth_basic_user_file /etc/nginx/.htpasswd;


according this, when i using (localhost:80) it redirects to ( with an authentication page. but, when i directly enter, it still can be accessible. is there any way which when i enter, it redirects to authentication page?

reference guide

nginix can and will block income connection (if used correctly), local connection will not be affected
inside the machine running and accessible but income connection from the outside world on port 80 will be secure and proxy the kibana for you.

many thanks

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.