Score:0

map nginx $http_MyHeaderName to port

cx flag

I want to create a mapping on nginx between $http_MyHeaderName and $port. I have much local hosted IIS sites and depending on header value nginx has to send request to one of them.

Config:

map $http_MyHeaderName  $port {
    Value1 4115;
    Value2 4116;
}

server {
    listen  80;
    #listen 443;
    
    server_name  localhost;


    location / {
        proxy_pass http://localhost:$port;
    }

Unfortunatelly I get 502 Bad gateway error and have no idea why?

Score:0
cx flag

Ok, I added this

resolver 172.6.16.16 [::1]; in location section and it works.

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.