Welcome! Log In Create A New Profile


how can restrict access to a site

Posted by sahererahimi 
how can restrict access to a site
December 16, 2018 05:24AM
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?
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 68
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready