Anyone any experience with this through an apache reverse proxy? I usually just do something like this:
RewriteRule ^/komga$ /komga/ [R]
<Location "/komga/">
ProxyPass "http://localhost:8080/"
ProxyPassReverse "http://localhost:8080/"
</Location>
Then set within the config of the app itself the baseURI property to be "/komga/" but not sure if this app has such a thing?
By default there is no base url set.
With Spring Boot you can set one by adding this configuration key: server.servlet.context-path=/komga.
You could try that and see if that works :)
In the application.yml file? I've added in that line but it failed to startup, I've added:
server:
servlet:
context-path: /komga
Into the application.yml and I now get a "HTTP Status 404 – Not Found" error message.
I just tested, it doesn't work, most likely because of other configuration like security and to handle the webui frontend.
I don't know much about Apache, i use Caddy for the reverse proxy, along with subdomains instead of path like /service
Anyone else manage to get anywhere with this? Just curious.
I'm currently running nginx on my server, and I'm seeing the same issue. I know apps like sonarr and radarr have a "url base" setting the user has to set to specify the subfolder you want to use, in order to access the app, so I bet something has to be done on the komga server side of things to get it to work.
To be honest reverse proxies should be able to redirect a subdirectory to a root folder of another server.
Adding a base url is complex because of the webui. If it was a simple backend api it would be a simple config (as shown above), but with the webui hosted on the same servlet it's a different story.
I had a further look, actually the problem is coming from the front-end, where the publicPath parameter can only be set during compile time. This is blocking because it cannot be changed dynamically. Until there is a solution in Vue Cli to allow this to be dynamic, there is not much solution, as the static assets on the front-end will always refer to a / root. Maybe some fancy rewrite directives could help, but i wasn't successful so far with caddy.
Thanks for taking a look! For the moment I've put this on its own URL where it works nicely.
I am in need of this as well.
The reason I do not want to setup subdomains is because I d o not want to maintian many subdomains and also sudmomains by nature open to scraping and parsing, I d onot want the world to know that I am runnning komga or whatever I am proxy. It is much harder to explore subpaths.
It seems webpack has a feature to define the public path on the fly, instead of compile time. However i cannot make it work with VueJS.
I think it would be possible to generate a JSP page on the server with the value of the servlet context path and inject this in the HTML, so that the client side Javascript can use it. But i can't even make the webpack on-the-fly feature work with a static value :(
I have a base-url branch that almost works.
There is one problem though, if you refresh the page from a url like /series/30363 then it won't reload the static assets properly.
I think it has something to do with the webpack configuration, which should load a single bundle that activates the __webpack_public_path__, but i can't get it to work.
Got it to work ! o/
Check version 0.14.2, you can set the configuration server.servlet.context-path to something like /komga, or if you use the environment variable use SERVER_SERVLET_CONTEXT_PATH.
seems to work for the UI, but OPDS links ignore the prefix:
e.g: /opds/v1.2/series/latest
seems to work for the UI, but OPDS links ignore the prefix:
e.g: /opds/v1.2/series/latest
Please open a new issue with all the details, thanks.
Most helpful comment
Got it to work ! o/
Check version
0.14.2, you can set the configurationserver.servlet.context-pathto something like/komga, or if you use the environment variable useSERVER_SERVLET_CONTEXT_PATH.