Skip to content

Allow Overriding Reverse Proxy Configuration with Environment Variables#3369

Open
chtzvt wants to merge 1 commit intojaneczku:masterfrom
chtzvt:chtzvt/proxy-override
Open

Allow Overriding Reverse Proxy Configuration with Environment Variables#3369
chtzvt wants to merge 1 commit intojaneczku:masterfrom
chtzvt:chtzvt/proxy-override

Conversation

@chtzvt
Copy link
Copy Markdown

@chtzvt chtzvt commented Apr 19, 2025

Hey there,

I recently encountered an identical issue to the problem described in #2401, and needed to implement a workaround that didn't rely on appending headers in the reverse proxy.

In my case, I use an opaque reverse proxy that isn't configurable, and I realized that others may encounter the same problem depending on their deployment scenario. Thus, this PR introduces an optional mechanism that allows the same set of configuration you'd otherwise apply in a reverse proxy's settings to be set with environment variables where calibre-web itself is hosted.

I can confirm that this works in my testing, as Kobo download links are generated properly and respect the overridden scheme, host, and port.

TL;DR

In addition to overriding request environment settings via X-Scheme and similar headers, calibre web will now respect the following overrides via environment variables:

  • To configure a path prefix override (script name), set PROXY_SCRIPT_NAME
  • To configure a scheme override, set PROXY_SCHEME
  • To configure a host override, set PROXY_HOST
  • To configure a port override, set PROXY_PORT

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant