Merged
Conversation
When the request URI was a subdomain (e.g. admin.atomgraph.com) and PROXY_HOST was set to the base domain (e.g. atomgraph.com), the filter replaced the entire host with proxyHost, losing the subdomain. The HTTP client then reused an existing SSL connection (SNI=atomgraph.com) for the subdomain request, causing nginx to return 421 Misdirected Request and breaking WebID agent loading in production. Fix preserves the subdomain prefix when building the rewritten URI. Adds unit tests covering exact host, subdomain, port, and query string cases. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The previous fix unconditionally prepended the subdomain prefix to proxyHost, which broke dev setups using an internal proxy hostname (e.g. PROXY_HOST=nginx): admin.localhost was rewritten to admin.nginx instead of nginx, which doesn't resolve in Docker. Only preserve the subdomain when proxyHost equals host (the production case where both are the same domain). In that case the HTTP client would otherwise reuse an existing connection with SNI=host for the subdomain request, causing nginx to return 421 Misdirected Request. Update test to reflect the correct behaviour for the internal-proxy case. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.