Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
sandreas opened this issue May 6, 2022 · 2 comments
Closed
Labels
enhancement New feature or request

Comments

@sandreas
Copy link
Contributor

sandreas commented 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?

@sandreas sandreas added the enhancement New feature or request label May 6, 2022
@advplyr
Copy link
Owner

advplyr commented 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 advplyr closed this as completed May 6, 2022
@sandreas
Copy link
Contributor Author

sandreas commented 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 #385

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants