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

399
Vistas
How does one set up an Nginx server to use WebSockets?

I have a website that needs to work through an Nginx server. At the moment, I don't believe the configuration for nginx is correct. I currently have

server{
        server_name websitename.com;

       location /websocket/{
                proxy_pass http://websitename.com;
                proxy_http_version 1.1;
                proxy_set_header Upgrade $http_upgrade;
                proxy_set_header Connection "Upgrade";
                proxy_set_header $host;
        }

}

At the moment, I am receiving an error on the website that reads "SCRIPT12008: SCRIPT12008: WebSocket Error: Incorrect HTTP response. Status code 200, OK", which I believe is because the protocol is not switching correctly.

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

0

You forgot the double quotes and "Host" before $host to set the Host directive:

 proxy_set_header "Host" $host;

So your setup would like this instead:

 server{ server_name websitename.com; location /websocket/{ proxy_pass "http://websitename.com"; proxy_http_version 1.1; proxy_set_header "Upgrad"e $http_upgrade; proxy_set_header Connection "upgrade"; proxy_set_header Host $host; } }

Always check your syntax with the 'nginx -t' command.

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