Dodawanie i używanie nagłówka (HTTP) w nginx

Korzystam z dwóch systemów (oba są systemem równoważenia obciążenia nginx i działają jako kopia zapasowa). Chcę dodać i użyć kilku niestandardowych nagłówków http. Podaj swoją sugestię

na przykład

  upstream upstream0{
            #list of upstream servers
            server backend:80;
            server backup_load_balancer:777 backup;
            #healthcheck
  }

  server{
        listen  80;
        #Add custom header about the port and protocol  (http or https)
        server_name     _;
        location / {
                proxy_pass "http://upstream0;#" is included since links are not allowed in the post
        }

   }

// System kopii zapasowej

server{
        listen  777;
        server_name     _;
        #doing some other extra stuf

        #use port and protocol to direct
}

Dzięki

questionAnswers(2)

yourAnswerToTheQuestion