elastic / kibana

Your window into the Elastic Stack
https://www.elastic.co/products/kibana
Other
19.59k stars 8.21k forks source link

404 not found for es behind reverse proxy #2528

Closed ChrisJNL closed 9 years ago

ChrisJNL commented 9 years ago

Hello, i'm having 404 issue

Kibana log

{"@timestamp":"2015-01-06T12:10:55+01:00","status":"404","level":"ERROR","name":"Kibana","request_method":"GET","request":"/elasticsearch/_nodes","path":"/elasticsearch/_nodes","query_string":"","remote_addr":"172.22.108.187","remote_user":null,"http_version":"HTTP/1.1","content_length":"36","response_time":63,"message":"GET /elasticsearch/_nodes 404 63ms - 36"}'

ngrep :

'T 172.22.108.188:8930 -> 172.22.108.190:80 [AP]
  GET /_nodes HTTP/1.1..Version: HTTP/1.1..Host: myserver.net..X_forwarded_for: XXX.XXX.XXX.XXX, XXX.XXX.XXX.XXX..Connection: close..Authorization: Bas
  ic YXRvczpAdDBz..Accept: application/json, text/plain, */*..User_agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.95 Saf
  ari/537.36..Referer: http://myserver.net/..Accept_encoding: gzip, deflate, sdch..Accept_language: fr,en-US;q=0.8,en;q=0.6..Cookie: _ga=GA1.2.12
  380067.1415118668..Cache_control: max-age=259200..User-Agent: Ruby....
##
T 172.22.108.190:80 -> 172.22.108.188:8930 [AP]
  HTTP/1.1 404 Not Found..Server: openresty..Date: Tue, 06 Jan 2015 11:07:13 GMT..Content-Type: application/json..Content-Length: 36..Connection: close..X-Cascade: pass..X-
  Content-Type-Options: nosniff....{"status":404,"message":"Not Found"}

reverse proxy configuration ( with cname)

upstream elasticsearch_qualif {
    server server1:9200 fail_timeout=5s max_fails=2 weight=10;
    server server2:9200 fail_timeout=5s max_fails=2 weight=10;
    keepalive 15;
}

server {
  include vhosts/common/top.conf;
  server_name myserver.net;

  access_log logs/access.log;
  error_log logs/error.log notice;

location ~ / {
    proxy_send_timeout 30s;
    proxy_read_timeout 30s;
    proxy_pass http://elasticsearch_qualif;
    proxy_http_version 1.1;
    proxy_set_header Connection "Keep-Alive";
    proxy_set_header Proxy-Connection "Keep-Alive";
  }

}

Thanks for your help

jar349 commented 8 years ago

@ChrisJNL How did you fix this? I have it too!