Company logo
  • Jobs
  • Bootcamp
  • About Us
  • For professionals
    • Home
    • Jobs
    • Courses
    • Questions
    • Teachers
    • Bootcamp
  • For business
    • Home
    • Our process
    • Plans
    • Assessments
    • Payroll
    • Blog
    • Calculator

0

200
Views
Socket.io 404 through NGINX reverse-proxy

Here's my issue: The socket.io handshake gets a 404.

I have an nginx reverse-proxy configuration that looks like that:

location /socket.io/ {
                proxy_http_version      1.1;
                proxy_set_header        Upgrade $http_upgrade;
                proxy_set_header        Connection "upgrade";
                proxy_set_header        Host $host;
                proxy_cache_bypass      $http_upgrade;
                proxy_pass              "http://localhost:3000";
        }

The weird thing is that, if I go to this url I get an answer

http://ipofmyserver:3000/socket.io/?EIO=3etc...

But the logs tell me that the requests are proxyied to this exact address...

Connection refused while connecting to upstream, client: [...], server: [...], request: "GET /socket.io/?EIO=3&transport=polling&t=N4DgMW5 HTTP/2.0", upstream: "http://[...]:3000/socket.io/?EIO=3&transport=polling&t=N4DgMW5", host: "[...]", referrer: "[...]"

So the upstream is exactly the address where I test manually, but it returns 404 when it goes through nginx...

Thanks anyone for answering this !

9 months ago · Santiago Trujillo
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post job Plans Our process Sales
Legal
Terms and conditions Privacy policy
© 2023 PeakU Inc. All Rights Reserved.