From 08a73b4aadebd9405ac52ec1f6eef5ca1fe8c11a Mon Sep 17 00:00:00 2001 From: Maxim Dounin Date: Mon, 18 Feb 2013 13:50:52 +0000 Subject: Proxy: support for connection upgrade (101 Switching Protocols). This allows to proxy WebSockets by using configuration like this: location /chat/ { proxy_pass http://backend; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; } Connection upgrade is allowed as long as it was requested by a client via the Upgrade request header. --- src/http/ngx_http_request.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/http/ngx_http_request.c') diff --git a/src/http/ngx_http_request.c b/src/http/ngx_http_request.c index e94e7fcce..763e7bf11 100644 --- a/src/http/ngx_http_request.c +++ b/src/http/ngx_http_request.c @@ -130,6 +130,10 @@ ngx_http_header_t ngx_http_headers_in[] = { offsetof(ngx_http_headers_in_t, expect), ngx_http_process_unique_header_line }, + { ngx_string("Upgrade"), + offsetof(ngx_http_headers_in_t, upgrade), + ngx_http_process_header_line }, + #if (NGX_HTTP_GZIP) { ngx_string("Accept-Encoding"), offsetof(ngx_http_headers_in_t, accept_encoding), -- cgit v1.2.3