Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug on redirect response behind proxy using x-pack for security #10204

Closed
javiercanillas opened this issue Feb 6, 2017 · 2 comments
Closed
Labels
bug Fixes for quality problems that affect the customer experience stale Used to mark issues that were closed for being stale Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc

Comments

@javiercanillas
Copy link

Kibana version: 5.2.0

Elasticsearch version: 5.2.0

Server OS version: Linux Ubuntu 14.04.5 LTS

Browser version: Chrome (guess it happens with everyone)

Browser OS version: 55.0.22883.95 (64 bit)

Original install method (e.g. download page, yum, from source, etc.): download page

Description of the problem including expected versus actual behavior:
When navigate to the base url path to load kibana up on browser and after successfully login, the redirect url sent to the browser is malformed.

Steps to reproduce:

  1. Installed ElasticSearch 5.2.0 with X-Pack security enabled.
  2. Installed Kibana 5.2.0 with X-Pack security enabled.
  3. Configured Kibana to point to elasticSearch cluster through configuration and to rewrite all relative resources with "/myKibana" for proxy requirements. See attached example
    kibana.yml.txt
  4. Installed on the same Kibana server a nginx version 1.11.4 to proxy kibana content through a different base url (instead of "/", to use "/kibana"). Check attached nginx configuration.
    nginx.conf.txt
  5. Startup elasticSearch
  6. Startup ngnix
  7. Startup kibana
  8. Navigate to "http://localhost:9290/myKibana", which it should proxy its request to "http://localhost:9280" and it should display login page.
  9. Login using elastic:changeme (it should be successful) but instead of going into any section of Kibana, a 404 Page is shown in the browser since the redirect url was "http://localhost:9290/myKibana//myKibana", instead of "http://localhost:9290/myKibana" or any other similar.

Errors in browser console (if relevant):
Request headers on step 9:
GET /myKibana/ HTTP/1.1 Host: localhost Connection: keep-alive Pragma: no-cache Cache-Control: no-cache Upgrade-Insecure-Requests: 1 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.95 Safari/537.36 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8 Accept-Encoding: gzip, deflate, sdch Accept-Language: es-ES,es;q=0.8,en;q=0.6,nb;q=0.4 Cookie: sid=Fe26.2**3f7854062f16552044b47ec44f405e56a74ec011045f8f21cfef860efe79a162*p13vnIKuS2hutbWCFbE2ig*Xic30G46cguJb14eIT_BzaQ9_oWsp1pdSb2Dc1t22C6u19-CVX0v5k37ypacK4TGVkvnB1aeD4d_YtHdfoPX0g**a5827735165a8f947509114279b368dbace3ced035b19623651eefb5cc3bf541*OlmT91YgtNK7VRjM6PCAgixHDqnnPGrb1ynjwPjc-HM

Response headers on step 9:
HTTP/1.1 301 Moved Permanently Server: nginx/1.11.4 Date: Mon, 06 Feb 2017 20:37:31 GMT Content-Length: 0 Connection: keep-alive location: /myKibana//myKibana kbn-name: kibana kbn-version: 5.2.0 kbn-xpack-sig: 328aa00558be47f59d8399ef0194996e cache-control: no-cache vary: accept-encoding

Provide logs and/or server output (if relevant): Didn't find any relevant information on logs about this.

@javiercanillas
Copy link
Author

I didn't mention, this starts happening when installed X-Pack.

And I think it might be related to this issue: #9226

@tbragin tbragin added Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc bug Fixes for quality problems that affect the customer experience labels Feb 8, 2017
@joshuar
Copy link

joshuar commented May 23, 2017

@javiercanillas is this still an issue with 5.4.0? With the following example bare nginx config, everything seems to work:

server {
  listen       8080;
  access_log  /var/log/nginx/proxy.access.log  main;

  location /kibana {
    proxy_pass  http://localhost:5601/;
    rewrite ^/kibana/(.*)$ /$1 break;
  }
}

Please adjust the port and path as appropriate and let us know how it goes?

@joshdover joshdover added the stale Used to mark issues that were closed for being stale label Jan 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Fixes for quality problems that affect the customer experience stale Used to mark issues that were closed for being stale Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc
Projects
None yet
Development

No branches or pull requests

4 participants