Add GeoChem hosting: proxy to Jataware-hosted instance - #8
Open
saggu wants to merge 2 commits into
Open
Conversation
/geochem and /geochem/ nginx location blocks, mirroring /dashboard's set \$upstream pattern (not the /api/-style direct proxy_pass, which resolves hostnames at config-load time rather than via the resolver directive). New geochem service in docker-compose.yml. Image name (minmod-geochem) and port (8060) are placeholders pending Ryan's actual container details -- see docs/GEOCHEM-HMI-INTEGRATION-SPEC issue on ta2-table-understanding. Verified: nginx -t against a scratch copy with machine-local paths/ certs substituted parses and validates cleanly past the new blocks; the only remaining failure (DNS resolution of Docker-network hostnames outside the docker network) is pre-existing and identical in the unmodified original file. docker-compose.yml's YAML parses correctly with all 8 services present.
Ryan's GeoChem HMI is hosted externally at https://proxy.usgs.geochem.jataware.ai/ (run by Jataware/USGS), not a container we build/run ourselves. Replaces the placeholder minmod-geochem:8060 docker-compose service and its two-block nginx proxy_pass (which used the set $upstream pattern for Docker-internal DNS timing) with a single /geochem/ location doing a literal-URI proxy_pass to the real external host, plus a /geochem -> /geochem/ redirect. Literal URI is required (not the file's usual set $upstream + bare proxy_pass idiom) so nginx strips the /geochem/ prefix before forwarding -- the upstream has no concept of that prefix. Adds websocket upgrade headers for the chat agent's /geochem/api/chat/ws and a 200M client_max_body_size for curator PDF uploads. Verified: nginx -t against a scratch copy (dummy certs, internal Docker hostnames neutralized) validates cleanly end-to-end. Ran the actual config in a container and hit it live: GET /geochem -> 301 to /geochem/; GET /geochem/ -> 200 with the real GeoChem Curation app HTML; GET /geochem/favicon.svg -> 200, confirming prefix-stripping works for sub-resources, not just the location root.
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.
Summary
https://proxy.usgs.geochem.jataware.ai/— no local container to build/run./geochem/nginx location does a literal-URIproxy_passto that host (so the/geochem/prefix is stripped before forwarding — the upstream has no concept of it), plus alocation = /geochemredirect to/geochem/.Upgrade/Connection, via a newmap $http_upgrade $connection_upgradein thehttpblock) for the chat agent at/geochem/api/chat/ws,client_max_body_size 200Mfor curator PDF uploads,proxy_ssl_server_name onfor SNI, and an explicitHostheader override to the upstream's real hostname (our LB routes byHost, so$hostwould 404).geochemservice fromdocker-compose.yml— nothing to build, so nomms/build.pyentry either.Test plan
nginx -tagainst a scratch copy (dummy certs, internal Docker hostnames neutralized) validates the full config cleanly end-to-endGET /geochem→ 301 to/geochem/;GET /geochem/→ 200 with the real GeoChem Curation app HTML;GET /geochem/favicon.svg→ 200, confirming prefix-stripping works for sub-resources toodocker-compose.ymlYAML parses correctly🤖 Generated with Claude Code
https://claude.ai/code/session_01KxZ4CixRWDzd9qGzJVBywr