Skip to content

nginx で websocket フォワード設定例

uzulla edited this page Apr 5, 2013 · 2 revisions

nginx version: nginx/1.3.14 での例です

server {
    listen       80;
    server_name  yancha.hachiojipm.org;
    location / {
        proxy_set_header Host $host;
        proxy_pass http://localhost:3000/;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection $connection_upgrade;
    }
    # some other settings....
    location /static/ {
        root   /path/to/static_htdocs/;
        index  index.html index.htm;
    }
}