Commit b3ab56bf1cff5380150f99c6c4665550acbee4ce
1 parent
b9461b46
Exists in
master
and in
1 other branch
fix websocket error
Showing
1 changed file
with
23 additions
and
0 deletions
Show diff stats
config/nginx.conf
... | ... | @@ -26,6 +26,29 @@ server { |
26 | 26 | proxy_pass http://puma; |
27 | 27 | } |
28 | 28 | |
29 | + location @websocket { | |
30 | + proxy_pass http://127.0.0.1:110; | |
31 | + proxy_http_version 1.1; | |
32 | + proxy_set_header Upgrade $http_upgrade; | |
33 | + proxy_set_header Connection $connection_upgrade; | |
34 | + proxy_set_header Host $host; | |
35 | + proxy_set_header X-Real-IP $remote_addr; | |
36 | + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | |
37 | + break; | |
38 | + } | |
39 | + | |
40 | + location /websocket { | |
41 | + proxy_pass http://puma/websocket; | |
42 | + proxy_http_version 1.1; | |
43 | + proxy_set_header X-Real-IP $remote_addr; | |
44 | + add_header Access-Control-Allow-Origin *; | |
45 | + try_files /system/maintenance.html $uri $uri/index.html $uri.html @ruby; | |
46 | + proxy_set_header Upgrade websocket; | |
47 | + proxy_set_header Connection Upgrade; | |
48 | + proxy_set_header X-Real-IP $remote_addr; | |
49 | + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | |
50 | + } | |
51 | + | |
29 | 52 | error_page 500 502 503 504 /500.html; |
30 | 53 | client_max_body_size 10M; |
31 | 54 | keepalive_timeout 10; | ... | ... |