[Enhancement]: Provide baseUri for scripts in config for proxy usage #342

Closed
opened 2026-04-24 23:05:29 +02:00 by adam · 2 comments
Owner

Originally created by @sandreas on GitHub (May 6, 2022).

Describe the feature/enhancement

Hello,

I'm trying to run audiobookshelf on my private Dyndns-URI (subdomain) behind a proxy with a virtual path which should provide the URI https://mydomain.com/audiobooks/ and internally redirect to http://<ip>:7331 (where audiobookshelf is hosted)..

Unfortunately it is a technical limitation and it is just not possible for me to configure a specific subdomain (like https://audiobookshelf.mydomain.com). Therefore I would like to run it behind an NGINX proxy:

location /audiobooks/ {
  proxy_pass http://<ip>:7331/;
  proxy_redirect     off;
  proxy_set_header   Host $host;
  proxy_set_header   X-Real-IP $remote_addr;
  proxy_set_header   X-Forwarded-For $proxy_add_x_forwarded_for;
  proxy_set_header   X-Forwarded-Host $server_name;
  break;
} 

The problem is, that all scripts are referenced with absolute paths (leading /), which leads to /_nuxt/319933d.js and other scripts beeing requested from https://mydomain.com/_nuxt/319933d.js and not from https://mydomain.com/_nuxt/319933d.js.

I think that should be configurable with some baseUri=https://mydomain.com/audiobooks/ variable.

Would that be possible?

Originally created by @sandreas on GitHub (May 6, 2022). ### Describe the feature/enhancement Hello, I'm trying to run `audiobookshelf` on my private Dyndns-URI (subdomain) behind a proxy with a virtual *path* which should provide the URI `https://mydomain.com/audiobooks/` and internally redirect to `http://<ip>:7331` (where `audiobookshelf` is hosted).. Unfortunately it is a technical limitation and it is just not possible for me to configure a specific subdomain (like `https://audiobookshelf.mydomain.com`). Therefore I would like to run it behind an NGINX proxy: ``` location /audiobooks/ { proxy_pass http://<ip>:7331/; proxy_redirect off; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Host $server_name; break; } ``` The problem is, that all scripts are referenced with absolute paths (leading `/`), which leads to `/_nuxt/319933d.js` and other scripts beeing requested from `https://mydomain.com/_nuxt/319933d.js` and not from `https://mydomain.com/_nuxt/319933d.js`. I think that should be configurable with some `baseUri=https://mydomain.com/audiobooks/` variable. Would that be possible?
adam added the enhancement label 2026-04-24 23:05:29 +02:00
adam closed this issue 2026-04-24 23:05:29 +02:00
Author
Owner

@advplyr commented on GitHub (May 6, 2022):

Yeah you have it right, we need to add a base url from env variables for the client side to work. Then there is the server and mobile apps. I've attempted to add this once before and it was more complicated then it seems. There is another issue open for this already though #385

@advplyr commented on GitHub (May 6, 2022): Yeah you have it right, we need to add a base url from env variables for the client side to work. Then there is the server and mobile apps. I've attempted to add this once before and it was more complicated then it seems. There is another issue open for this already though #385
Author
Owner

@sandreas commented on GitHub (May 7, 2022):

Yeah you have it right, we need to add a base url from env variables for the client side to work.

Thank you for the quick response.

There is another issue open for this already though https://github.com/advplyr/audiobookshelf/issues/385

My bad, I looked for an issue but maybe I did not use the needed search term.

@sandreas commented on GitHub (May 7, 2022): > Yeah you have it right, we need to add a base url from env variables for the client side to work. Thank you for the quick response. > There is another issue open for this already though https://github.com/advplyr/audiobookshelf/issues/385 My bad, I looked for an issue but maybe I did not use the needed search term.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/audiobookshelf#342