Nginx infinte redirection for kibana on centOS 7 -
i have no experience reverse proxying, let alone nginx , struggling.
versions:
- kibana: 5.6 
- nginx: 1.10.2 
when go elk.mydomain.com/kibana, redirected in loop until firefox stops me after massively long link this:
http://elk.mydomain.com/kibana/login?next=%2fkibana%2fkibana%2flogin%3fnext%3d%252fkibana%252fkibana%252flogin%253fnext%253d%25252fkibana%25252fkibana%25252flogin%25253fnext%25253d%2525252fkibana%2525252fkibana%2525252flogin%2525253fnext%2525253d%252525252fkibana........
i have been trying small adjustments every little thing no luck.
cat /etc/nginx/conf.d/kibana.conf:
server { listen 80; server_name elk.mydomain.com; auth_basic "restricted access"; auth_basic_user_file /etc/nginx/conf.d/kibana.htpasswd; location /kibana/ {   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; } } netstat -ntlpu | grep 5601:
tcp .... 127.0.0.1:5601  0.0.0.0:* ... listening
in /etc/kibana/kibana.yml have:
server.host: "localhost" # have tried "elk.mydomain.com" server.basepath: "/kibana" # have tried "" server.name: "a_label" when check locally httpie (http :5601) found.
i stuck here.
i found answer:
https://discuss.elastic.co/t/reverse-proxy-kibana/43647/14
i changed location in /etc/nginx/conf.d/kibana.conf snippet following:
location ~ ^/kibana/(.*)$ {         rewrite /kibana/(.*) /$1 break;         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;     } i'm not sure what's happening works. maybe nginx awareness can explain this? consuming part of link (as mentioned in post).
Comments
Post a Comment