From c17fdf1f11dd23f4cbaaa42f80629d16cccd88d0 Mon Sep 17 00:00:00 2001 From: coderaiser Date: Thu, 9 Jan 2014 11:30:58 +0200 Subject: [PATCH] docs(help) nginx: add websockets --- HELP.md | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/HELP.md b/HELP.md index 8cc43f6a..289a66bd 100644 --- a/HELP.md +++ b/HELP.md @@ -245,7 +245,14 @@ server { server_name io.cloudcmd.io; access_log /var/log/nginx/io.cloudcmd.io.access.log; location / { - proxy_pass http://127.0.0.1:8000/; + # websocket block + # support for nginx from v1.3.13 + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "upgrade"; + # websocket block + + proxy_pass http://127.0.0.1:8000/; } } ``` @@ -267,6 +274,19 @@ server { } ``` +For websocket suport (nginx >= v1.3.13) modify server block: + +```sh + location / { + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "upgrade"; + + proxy_pass http://127.0.0.1:8000/; + } +``` + + If you need redirection from **http** to **https**, it's simple: ```sh