Skip to content

Conversation

thelamer
Copy link
Member

@thelamer thelamer commented Sep 4, 2025

I have tested this pretty thoroughly at this point, it is bolt on logic so will not have an effect on any existing setups unless you can think of any possible reason someone would be passing an env var starting with "PROXY_CONFIG_" to a swag container.

The most basic string is incredibly useful to do subdomain setup to a port using a service name as :

- 'PROXY_CONFIG_WEBTOP={"port": 3000}'

This basically just works in most cases subdomain to a port, but all the options are there to get way more complex like in the case of Plex:

      PROXY_CONFIG_PLEX: '{"port":32400,"proxy_redirect_off":true,"buffering_off":true,"proxy_set_headers":[{"key":"X-Plex-Client-Identifier","value":"$http_x_plex_client_identifier"},{"key":"X-Plex-Device","value":"$http_x_plex_device"},{"key":"X-Plex-Device-Name","value":"$http_x_plex_device_name"},{"key":"X-Plex-Platform","value":"$http_x_plex_platform"},{"key":"X-Plex-Platform-Version","value":"$http_x_plex_platform_version"},{"key":"X-Plex-Product","value":"$http_x_plex_product"},{"key":"X-Plex-Token","value":"$http_x_plex_token"},{"key":"X-Plex-Version","value":"$http_x_plex_version"},{"key":"X-Plex-Nocache","value":"$http_x_plex_nocache"},{"key":"X-Plex-Provides","value":"$http_x_plex_provides"},{"key":"X-Plex-Device-Vendor","value":"$http_x_plex_device_vendor"},{"key":"X-Plex-Model","value":"$http_x_plex_model"}],"extra_locations":[{"path":"/library/streams/","custom_directives":["proxy_pass_request_headers off"]}]}'

The docced examples show the - array member syntax with escaped $ being double $$ and the whole thing being wrapped in single quotes but the object syntax like the plex example above is much more forgiving.

I think this is a good first step and maybe down the line we can look at using jinja templates for the ini generation and get everything in an env var format if possible.

@thelamer thelamer requested a review from a team September 4, 2025 15:07
@LinuxServer-CI LinuxServer-CI moved this to PRs Ready For Team Review in Issue & PR Tracker Sep 4, 2025
@LinuxServer-CI LinuxServer-CI moved this from PRs Ready For Team Review to PRs in Issue & PR Tracker Sep 4, 2025
@LinuxServer-CI
Copy link
Contributor

I am a bot, here is the pushed image/manifest for this PR:

ghcr.io/linuxserver/lspipepr-swag:5.0.0-pkg-a45fe600-dev-10cd287728a6f332e401084358cfeb3a1ab801f9-pr-586

@LinuxServer-CI
Copy link
Contributor

I am a bot, here is the pushed image/manifest for this PR:

ghcr.io/linuxserver/lspipepr-swag:5.0.0-pkg-a45fe600-dev-d6cfc8d3e2d9cd9fecee13e34126f461931842cc-pr-586

@thelamer
Copy link
Member Author

thelamer commented Sep 4, 2025

Made the env tamplates directory a dedicated thing so it will not delete anyone's custom configs.

@LinuxServer-CI
Copy link
Contributor

I am a bot, here is the pushed image/manifest for this PR:

ghcr.io/linuxserver/lspipepr-swag:5.0.0-pkg-2deef27a-dev-218b4ab8ab3e06a62e930c2419cfcdada600fca3-pr-586

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

Successfully merging this pull request may close these issues.

2 participants