Run overseerr on subpath, Base URL
Is your feature request related to a problem? Please describe. I'm reverse-proxying all services on main domain with caddy. Like https://example.com/radarr/ and https://example.com/sonarr/ and I want to do same with https://example.com/overseerr/ But currently it expects to be available on / path.
Describe the solution you'd like
Solution would be either to use relative URL's throughout the project. Or allow to specify base url/path in startup parameters, like PORT is specific in env variables. Like export BASE=/overseerr would be good enough for me.
Have to agree with this, it's really only usable for me to tinker with once in awhile. Can't have any other users try it out without letting it through the proxy.
Have to agree with this, it's really only usable for me to tinker with once in awhile. Can't have any other users try it out without letting it through the proxy.
You could always run it through a proxy on a subdomain, if your setup permits.
Subpath will take some time to figure out. Might be awhile :(
I'd love to make this work as well
Have to agree with this, it's really only usable for me to tinker with once in awhile. Can't have any other users try it out without letting it through the proxy.
You could always run it through a proxy on a subdomain, if your setup permits.
Subpath will take some time to figure out. Might be awhile :(
Kind of a bummer, I don't currently have the option to do a subdomain without a bit of work. Not in the cards at the moment. Look forward to where this goes though.
Isn't this just a matter of setting the baseurl in next config and doing namespace in express? Can you elaborate on what is hindering this @sct ?
iirc next does not really support setting dynamic baseurls in runtime, so it would be have to built with it already set.
Oh, yeah that's true. So the solution for us would be to prepend every use we have of express, links etc with an env variable we can pass in to the docker image for instance?
Sounds a little hacky, unless you have something centralized that would generate links already. I didn't check your codebase yet.
I'd personally settle with setting it at build-time, it's not often you will change this i feel.
Changing base path in next.config.js is only part of solution. It works and makes app to listen on correct base path (this is a build time setting). I've tried it and it works. But you need to change also all XHR requests in frontend from /api to $base/api. This involves all calls to axios.get/post and useSWR in frontend code.
I was planning to do this, but was busy past few weeks finishing #538. My plan was to have build setting in some config file that gets used in both frontend and server. That would be good enough for my usage. Doing this as runtime settings would be much much more work to figure out how to do it.
But if somebody is doing this, then let me know and I won't look at this.
But if somebody is doing this, then let me know and I won't look at this.
Looks like no one is ha
As far as I understand it, setting the base url at build time doesn't work super well with Docker because generally a base url change will require the frontend to be recompiled, which means that you'd either have to
- do frontend compilation as part of the container entry point (at runtime), or
- require that anybody changing their base url builds their own docker container.
Neither is very appealing in the long run, though they're both far better in the short term than not being able to use the app at all (for many of our use-cases).
To be able to set the base url at runtime, you'd need a couple things:
-
to be able to serve up the static files (js bundles, index.html, images, etc.) from a dynamic base url at runtime (server restart would be fine). In a normal non-SSR app this would be pretty easy, not sure how it changes with Next.
-
to know, in frontend code, what base url it's currently being served from (to prefix api calls).
-
Maybe next could dynamically hydrate the frontend with the base url that it's serving it from somehow? Not sure how that would affect asset paths like images and such, but it would make api call prefixing pretty simple.
I have all my apps setup using subfolders, I can't really use this without suborder reverse proxy, as I already have my home server on a subdomain.
All,
There is an unsupported workaround in the overseerr docs. Please use it at your own risk! This could break at any point. No support will be given for this workaround.
If you are having issues please verify that it is reproducible when accessing overseerr directly!
https://docs.overseerr.dev/extending-overseerr/reverse-proxy-examples#nginx
And to be clear, we are still looking into building this support into Overseerr directly. But ETA for that is still unknown.
Any chance this is going to be looked at again? I notice that it's been removed from the roadmap.
/b
@brettpetch Please see the comment right above yours. https://github.com/sct/overseerr/issues/274#issuecomment-792391378. Please do not post in issues asking for status updates. We are diligent in updating issues as things change. We provide no ETAs.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Hide this comment pls
Would really love this feature and am willing to contribute.
I've implemented this feature in my private repo (see PR: https://github.com/ElMoselYEE/overseerr/pull/1) but it only works when using build-time variables; I'm hitting a blocker with how to achieve this at runtime. @mmgoodnow your comments about dynamic frontend hydration seem promising although I'm not really sure how to implement such a workflow.
@ElMoselYEE Feel free to join us on Discord to discuss!
The lack of this feature is preventing Overseerr from being made available to many Plex VPS providers.

Would really love this feature and am willing to contribute.
I've implemented this feature in my private repo (see PR: ElMoselYEE#1) but it only works when using build-time variables; I'm hitting a blocker with how to achieve this at runtime. @mmgoodnow your comments about dynamic frontend hydration seem promising although I'm not really sure how to implement such a workflow.
I also would really love this feature. I hope you dont mind but i am taking a swing at making this configurable without needing a rebuild.
Oh, I forgot to ever reply to this. I was sort of picturing a situation where, when index.html is requested, you read the file and splice a script tag into it:
<script>
window.baseUrl = ${process.env.BASE_URL}
</script>
Then after that interpolation you can send it off to the client who can read from that window var.
Yep that's essentially what i have done except instead of using a global script it is using Runtime Configuration
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
I did this with my app I've been working on (not Next, just React) - not sure if it would help you figure something out: https://www.freecodecamp.org/news/how-to-implement-runtime-environment-variables-with-create-react-app-docker-and-nginx-7f9d42a91d70/
This would be the full implementation for what @mmgoodnow posted above.
For the moment this Workaround using nginx is still valid: https://github.com/sct/overseerr/pull/1114
In case anyone is interested for a way to do this with Traefik, I've got it working with the following:
Setup a supplemental nginx container called overseerr-web that uses the setup from the documentation for a subpath (#1114
Then gave it the following labels
labels:
traefik.docker.network: 'web'
traefik.enable: 'true'
traefik.http.routers.overseerr-web.entrypoints: 'websecure'
traefik.http.routers.overseerr-web.rule: 'Host(`media.example.net`) && PathPrefix(`/overseerr`)'
traefik.http.routers.overseerr-web.service: 'overseerr-web'
traefik.http.services.overseerr-web.loadbalancer.server.port: '80'
# Fix trailing slash
traefik.http.middlewares.strip-prefix.chain.middlewares: 'strip-prefix-1,strip-prefix-2'
traefik.http.middlewares.strip-prefix-1.redirectregex.regex: '^(https?://[^/]+/[a-z0-9_]+)$$'
traefik.http.middlewares.strip-prefix-1.redirectregex.replacement: '$${1}/'
traefik.http.middlewares.strip-prefix-1.redirectregex.permanent: 'true'
traefik.http.middlewares.strip-prefix-2.stripprefixregex.regex: '/[a-z0-9_]+'
Of course I've sanitized some labels, but this is currently working for me. I am personally using the PathPrefix "/request" and have adjusted the nginx file accordingly.
Hope this helps someone.
I see all these mentions of people implementing hacks etc. I notice on the docker site, there are versions by different authors available. Anyone know if there's a hack for Apache or another docker version that does offer this? I really need it.