Category Hierarchy

我想设置一个反向代理来使用用户名和密码访问kibana,所以我遵循了这个tutorial。

当我使用URL访问http://elastic.local时,超时发生,什么也没有发生。但是当我使用127.0.0.1:80时,它在不提示任何凭据的情况下访问kibana。我想使用例如http://elastic.local访问kibana,但无法使其工作,我已经谷歌了很多解决方案和许多Nginx配置文件,但似乎没有一个工作。

这是我的配置文件,名为'default‘,位于etc/nginx/site-available中,符号链接已经创建并位于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 :我已经在我的Ubuntu虚拟机中安装了ELK堆栈,它工作得很好,我可以使用http://127.0.0.1:5601访问kibana

转载请注明出处:http://www.baquan404.com/article/20230526/1210044.html