Steve Klabnik

Nginx gains support for WebSockets

I saw this commit land a few days ago, and now it’s out in a release. nginx 1.3.13 has support for proxying WebSockets requests.

What does that mean? Well, let’s look at the commit that introduced the change:

This allows to proxy WebSockets? by using configuration like this:

location /chat/ {

    proxy_pass ​http://backend;
    proxy_http_version 1.1;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection "upgrade";


A nice example, right there! Before you could do this, you needed to do some kind of extra tricks, like using varnish in front of nginx and having varnish proxy the requests straight to your back end servers. Super awkward.

You can grab a copy of nginx 1.3.13 on their download page.

Discuss on Hacker News.


Sign in or Join to comment or subscribe

Player art
  0:00 / 0:00