kafka-ui icon indicating copy to clipboard operation
kafka-ui copied to clipboard

Unable to access kafka ui when using reverse proxy

Open noygafni opened this issue 1 year ago • 2 comments

Issue submitter TODO list

  • [X] I've looked up my issue in FAQ
  • [X] I've searched for an already existing issues here
  • [X] I've tried running master-labeled docker image and the issue still persists there
  • [X] I'm running a supported version of the application which is listed here

Describe the bug (actual behavior)

I have a nginx gateway for accessing multiple web services from the same base url. Here is an example of my nginx.conf:

server {
    listen       80;

    location /kafka-ui {
      ...
      proxy_pass      http://kafka-ui:8080;
    }
  }

So if my url is www.example.com when I access http://www.example.com/kafka-ui it internally directs me to the kafka ui application. The problem is that kafka ui request static assets from the base url, not from /kafka-ui so it is unable to get those static files because they do not exists on the base url. Here is an example of the network tab in chrome dev-tools:

  1. request for http://www.example.com/kafka-ui
  2. request for http://www.example.com/assets/ace-042f3d64.js

you can see that it tries to access the root / instead of /kafka-ui to get the js file.

Expected behavior

The expected behavior is that the static files will be accessed from the local access point of the url. In my example above it should request the static files from http://www.example.com/kafka-ui/assets/ace-042f3d64.js instead of http://www.example.com/assets/ace-042f3d64.js.

Your installation details

I run kafka ui in docker compose on a linux server and the nginx is on the same docker network as kafka ui. Kafka ui version is 7.0.1

Steps to reproduce

Run kafka ui and nginx (or any other proxy tool you want) and try to access kafka ui from the nginx ip.

Screenshots

No response

Logs

No response

Additional context

No response

noygafni avatar Sep 13 '23 11:09 noygafni

Hello there noygafni! 👋

Thank you and congratulations 🎉 for opening your very first issue in this project! 💖

In case you want to claim this issue, please comment down below! We will try to get back to you as soon as we can. 👀

github-actions[bot] avatar Sep 13 '23 11:09 github-actions[bot]

I just ran into this problem and was able to fix it with SERVER_SERVLET_CONTEXT_PATH

e.g. like here https://github.com/provectus/kafka-ui/blob/53a6553765a806eda9905c43bfcfe09da6812035/documentation/compose/nginx-proxy.yaml#L16-L19

PTaylour avatar Dec 13 '23 20:12 PTaylour