I want to set up a reverse proxy to access kibana using a username and a password, so I followed this tutorial.
When I use the URL http://elastic.local to access kibana the timeout occurs and nothing happen. But when I use 127.0.0.1:80 it accesses kibana without prompting any credentials. I want to access kibana using for example http://elastic.local but can't make it work, I already googled a lot of solutions and many Nginx configuration files but none of them seems to work.
This is my configuration file named 'default' and located in etc/nginx/site-available and The symbolic link is already created and located under etc/nginx/site-enabled :
server {
listen 80;
server_name elastic.local;
auth_basic "Restricted Access";
auth_basic_user_file /etc/nginx/htpasswd.users;
location / {
proxy_pass http://localhost:5601;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
}
PS : I already have ELK stack in my Ubuntu vm, and it's working fine and i can access kibana using http://127.0.0.1:5601