github uNetworking/uWebSockets v20.44.0

latest releases: v20.67.0, v20.66.0, v20.65.0...
16 months ago

HTTP error pages

NGINX is a silly proxy. It's very common for users to report issues with NGINX, and it's easy to understand. If you set up NGINX as proxy for uWS, you will most likely get a spinning wheel followed by 502 Bad Gateway as if the uWS server is unreachable.

This is because NGINX defaults to the 27 year old, ancient, HTTP/1.0 when talking to backend servers. uWS naturally does not support this protocol, and is only fully standards compliant with the 26 years younger HTTP/1.1 RFC9112.

However, ideology aside, it would be nice if uWS played along with existing ecosystems. Now it does:

screencapture-localhost-9002-some-path-2023-05-28-11_37_12

This page is what you will see after setting up NGINX to proxy uWS. From this error it should hint of the proxy_http_version 1.1 config in NGINX. Once applied, the NGINX -> uWS combo will give you this:

screencapture-localhost-3000-2023-05-28-11_41_15

You can see and configure the error pages in src/HttpErrors.h. More errors will be added as they are needed. The default style is a minimal Apache-like page.

Don't miss a new uWebSockets release

NewReleases is sending notifications on new releases.