Skip to content

How-To Question: Need to write a proxy_pass statement but the upstream name is dynamically created in nginx-proxy docker version #2269

Answered by SchoNie
bplein asked this question in Q&A
Discussion options

You must be logged in to vote

The upstream name is not random. It is a sha1-hash of the VIRTUAL_PATH. So once you calculate it, you can re-use it.
In the Per-VIRTUAL_PATH location configuration there is a shell command to get the hash of the URL.
Or you could copy it from the generated config.

But normally nginx-proxy does the complex stuff for you.
See: Per-VIRTUAL_HOST location configuration and Per-VIRTUAL_PATH location configuration
If you create the _location file nginx-proxy will include it and you do not have to reference it.

Replies: 3 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by bplein
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants