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 - mySql Join with 4 tables -

css - Text drops down with smaller window -

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -