Skip to content

Commit 309c6ce

Browse files
feat(router): Support for WebSockets
Pass upgrade headers through the router to allow applications to use WebSockets. Fixes #1061
1 parent 72a15c0 commit 309c6ce

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

router/templates/nginx.conf

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,11 @@ http {
3434
access_log /dev/stdout;
3535
error_log /dev/stdout;
3636

37+
map $http_upgrade $connection_upgrade {
38+
default upgrade;
39+
'' close;
40+
}
41+
3742
## start deis-controller
3843
{{ if .deis_controller_host }}
3944
upstream deis-controller {
@@ -80,6 +85,9 @@ http {
8085
proxy_connect_timeout 10s;
8186
proxy_send_timeout 1200s;
8287
proxy_read_timeout 1200s;
88+
proxy_http_version 1.1;
89+
proxy_set_header Upgrade $http_upgrade;
90+
proxy_set_header Connection $connection_upgrade;
8391

8492
proxy_next_upstream error timeout http_502 http_503 http_504;
8593

0 commit comments

Comments
 (0)