opensearch-project / reporting

Export and automate PNG, PDF, and CSV reports in OpenSearch Dashboards
https://opensearch.org/docs/latest/dashboards/reporting/
Apache License 2.0
28 stars 66 forks source link

[BUG] reverse proxy rewrite rules break pdf/png report generation #17

Closed zhongnansu closed 2 years ago

zhongnansu commented 3 years ago

Describe the bug A clear and concise description of what the bug is.

To Reproduce Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior A clear and concise description of what you expected to happen.

Plugins Please list all plugins currently enabled.

Screenshots If applicable, add screenshots to help explain your problem.

Host/Environment (please complete the following information):

Additional context Add any other context about the problem here.


The current default behaviour for kibana (due to change with version 8), is that if you configure the server.basepath, then you also need to configure your reverse proxy to rewrite the url to remove the basepath. This behaviour is configurable from 6.3 (via server.rewriteBasePath) but the default behaviour still assumes the proxy is rewriting the url.

(quote from the 5.6 docs as they do a better job of explaining it than later versions)

server.basePath:
    Enables you to specify a path to mount Kibana at if you are running behind a proxy. This only affects the URLs generated by Kibana, your proxy is expected to remove the basePath value before forwarding requests to Kibana.

https://github.com/opendistro-for-elasticsearch/kibana-reports/pull/313 works only if the server.rewriteBasePath is set to true, which isn't the default configuration

Otherwise chromium makes a request to http://0:5601/basepath/app/visualize... and gets a 404.

This issue is submitted by @ccottam https://github.com/opendistro-for-elasticsearch/kibana-reports/issues/333

zhongnansu commented 2 years ago

After checking the original thread from opendistro, I think we can close this issue. The default server.basePath going ahead is likely to be true. Also since we recently enabled configuring the reporting server, this is not lkely to cause any issue

# Specifies whether OpenSearch Dashboards should rewrite requests that are prefixed with
# `server.basePath` or require that they are rewritten by your reverse proxy.
# This setting was effectively always `false` before OpenSearch Dashboards 6.3 and will
# default to `true` starting in OpenSearch Dashboards 7.0.
#server.rewriteBasePath: false