NGINX using $server_port in upstream -


i want proxy_pass upstream has 1 host multiple ports. have:

upstream myups {   zone myups 32k;   server myups.hostname.com:$server_port; } 

when try configuration , reload nginx, following:

"invalid port in upstream"

the basic idea simple, want keep port passed in server (server_port), , use when pass on upstream. can hard code port numbers in upstream this:

... server myups.hostname.com:1234; ... 

and work every time specific port. need able use multiple ports.

edit - proxy_pass looks like:

proxy_pass http://myups; -or- proxy_pass http://myups:$server_port; 

i not know if second 1 right, playing see if possible pass port number location upstream.

other things ive tried didnt work:

setting parameter in map acting global variable. specifying port "location" section of server. set hash (only works ip doesnt here.).


Comments

Popular posts from this blog

php - SPIP: From Tag directly to an article -

jquery - isAjaxRequest always return false -

ruby on rails - In a controller spec, how to find a specific tag in the generated view? -