Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

274
Visualizações
why nginx reserve proxy upstream is a static website, there are many TIME_WAIT? how to slove

the nginx config:(the config is for aspnet core, but now test for a static website on iis)

server {
        listen       80;
        server_name  localhost;

        location / {
            proxy_pass         http://localhost:81;
            proxy_http_version 1.1;
            proxy_set_header   Upgrade $http_upgrade;
            proxy_set_header   Connection keep-alive;
            proxy_set_header   Host $host;
            proxy_cache_bypass $http_upgrade;
            proxy_set_header   X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_set_header   X-Forwarded-Proto $scheme;
        }

        error_page   500 502 503 504  /50x.html;
        location = /50x.html {
            root   html;
        }
    }

after every times access http://localhost from chrome, TIME_WAIT + 1.

this both happened on windows 10 + nginx and ubuntu 16.04 + nginx

why this happened? how to slove this? for help

i tried change the kernel config, but that isn't what i want, i need to know why this happened? is my nginx config lead this? or else?

over 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

0

I presume you are concerned about port exhaustion. You should change your proxy_pass to use an upstream block, and then enable a keep-alive pool on the upstream. eg:

upstream backend {
    server 127.0.0.1:81;
    keepalive 20;
}

location / {
    proxy_pass         http://backend;
    proxy_http_version 1.1;
    proxy_set_header   Upgrade $http_upgrade;
    ...
}

Also have a look at the NGINX blog: https://www.nginx.com/blog/overcoming-ephemeral-port-exhaustion-nginx-plus/

over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda