Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Doc Info: Direct support for websockets with Nginx>=1.3.13 #371

Closed
davecoutts opened this issue Mar 15, 2013 · 1 comment
Closed

Doc Info: Direct support for websockets with Nginx>=1.3.13 #371

davecoutts opened this issue Mar 15, 2013 · 1 comment
Assignees

Comments

@davecoutts
Copy link

The snippet below could be added to the circushttpd document.
https://github.com/mozilla-services/circus/blob/master/docs/source/circushttpd.rst

Running circus-web in Nginx, with websocket support. Nginx>=1.3.13
As of Nginx>=1.3.13 websockets are supported by the web server.
With Nginx>=1.3.13 there is no longer a need to reroute websocket traffic via Varnish or Haproxy.

On Ubuntu you can install Nginx>=1.3.13 from Chris Lea's development branch PPA, as so,

sudo apt-get install python-software-properties
sudo add-apt-repository ppa:chris-lea/nginx-devel
sudo apt-get update
sudo apt-get install nginx
nginx -v

An example Nginx config with websocket support.

# /etc/nginx/sites-enabled/default

upstream circusweb_server {
        server localhost:8080;
}

server {

    listen   80;
    server_name  _;

    location / {
            proxy_pass http://circusweb_server;
            proxy_http_version 1.1;
            proxy_set_header Upgrade $http_upgrade;
            proxy_set_header Connection "upgrade";
            proxy_set_header Host $host;

            proxy_set_header X-Real-IP $remote_addr;
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_set_header X-Forwarded-Proto http;

            proxy_redirect off;
    }

    location ~/media/*(.png|.jpg|.css|.js|.ico)$ {
        alias   /path_to_site-packages/circusweb/media/;
    }

}
@tarekziade
Copy link
Member

thanks! will add it

@ghost ghost assigned tarekziade Mar 16, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants