/api/socket returns 405 Method Not Allowed

Zangetsu2 years ago

@Thiago Azevedo Yes! I added connection_upgrade variable to my nginx.conf (example below:)

map $http_upgrade $connection_upgrade {
        default upgrade;
        '' close;
    }

And ignored the fact that the http request returns 405. The sockets still connect regardless.

You can view the source code of Traccar here you can see that they just create a socket instance and connect regardless of the http request return result.

Hope this helps!

Thiago Azevedo2 years ago

Thank you, it was a great help!

Track-trace2 years ago

@Zangetsu,

So what does this Nginx.conf code actually do ?

 map $http_upgrade $connection_upgrade {
        default upgrade;
        '' close;
    }

P.s.
Can you also show me your nginx config please.