Quantcast
Channel: Nginx Forum - How to...
Viewing all articles
Browse latest Browse all 4759

how can restrict access to a site

$
0
0
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 / {
proxy_pass http://192.168.170.149:5601;
auth_basic "Restricted";
auth_basic_user_file /etc/nginx/.htpasswd;
}

}


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

Viewing all articles
Browse latest Browse all 4759

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>