Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

273
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda