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

603
Vistas
nginx: no handler for server

I am trying to configure nginx proxy for a tcp service, the http proxy stuff works as expected. However, I keep getting this error for the server inside the stream context.

no handler for server in /etc/nginx/nginx.conf:6

I don't understand how it's different from the servers defined in the http context.

events {

}

stream {
      server {
        listen 5601;
        deny   all;
    }
}

http {

    server {
        listen 80;
        server_name example.com;
        location / {
            proxy_set_header   X-Forwarded-For $remote_addr;
            proxy_set_header   Host $http_host;
            return 301 https://$host$request_uri;
        }
        location /.well-known/acme-challenge/ {
            root /var/www/certbot;
        }
    }
    server {
        listen 443 ssl;
        server_name example.com;
        ssl_certificate /etc/letsencrypt/live/example.com/fullchain.pem;
        ssl_certificate_key /etc/letsencrypt/live/example.com/privkey.pem;
        include /etc/letsencrypt/options-ssl-nginx.conf;
        ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;

        location / {
            proxy_pass http://example.com:5601;
        }
    }
}

What does this error mean and how do I fix this?

over 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

The problem lies here:

listen 5601;
deny   all;

The listen dont understand, what will I am to do for listen here? Immediately it found a deny all;. what will I am doing with deny?. So you must tell the listen to what to do it stand for. For ex:

listen 853;
proxy_pass 127.0.0.1:53;

Here, I ordered listen to do something. So it know what to do it stand for. It was there to listen on port 853 and then proxying to localhost. Ya, somethink like that. Dont forget to restart

sudo systemctl restart nginx.services

You said:

I don't understand how it's different from the servers defined in the http context.

Sure. Because server on http know what to do after listen. :)

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