dbeaver / cloudbeaver

Cloud Database Manager
https://dbeaver.com/
Apache License 2.0
3.32k stars 365 forks source link

Host behind a reverse proxy on a subfolder #2017

Closed JeanRessouche closed 11 months ago

JeanRessouche commented 11 months ago

Hi, my scenario: nginx or caddy reverse proxy as a docker container send /tools/db to http://dbeavercontainer:8978

Caddy2 config to do so:

  redir /tools/db /tools/db/
  handle /tools/db/* {
    reverse_proxy http://dbeaver:8978 {
      header_up Host {http.reverse_proxy.upstream.host}
      header_up X-Real-IP {http.request.remote}
    }
  }

Reading the doc, i saw that we can edit cloudbeaver.conf and set server.rootURI & server.serviceURI to achieve my goal (i think)

{
    server: {
        serverPort: 8978,
        serverHost: "localhost",
        serverName: "CloudBeaver Sample Server",

        workspaceLocation: "workspace",
        contentRoot: "web",
        driversLocation: "drivers",

        rootURI: "/tools/db/",
        serviceURI: "/tools/db/api/",
        ...
}

But this doesn't work. Static content is correctly returned bu api calls end with an error 404. I tried mutiple variations and still fail :'(

image

Any help ?

JeanRessouche commented 11 months ago

Ok, correct way was simply...

    rootURI: "/tools/db/",
    serviceURI: "/api/",