From b3ab56bf1cff5380150f99c6c4665550acbee4ce Mon Sep 17 00:00:00 2001 From: renansoares Date: Wed, 30 Mar 2016 21:18:05 -0300 Subject: [PATCH] fix websocket error --- config/nginx.conf | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+), 0 deletions(-) diff --git a/config/nginx.conf b/config/nginx.conf index 33fc78b..33e0190 100644 --- a/config/nginx.conf +++ b/config/nginx.conf @@ -26,6 +26,29 @@ server { proxy_pass http://puma; } + location @websocket { + proxy_pass http://127.0.0.1:110; + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection $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; + break; + } + + location /websocket { + proxy_pass http://puma/websocket; + proxy_http_version 1.1; + proxy_set_header X-Real-IP $remote_addr; + add_header Access-Control-Allow-Origin *; + try_files /system/maintenance.html $uri $uri/index.html $uri.html @ruby; + proxy_set_header Upgrade websocket; + proxy_set_header Connection Upgrade; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + } + error_page 500 502 503 504 /500.html; client_max_body_size 10M; keepalive_timeout 10; -- libgit2 0.21.2