Task #5105
closedEnable WebSocket support on nginx for infrastructure gateway
100%
Description
WebSocket is a protocol providing full-duplex communication channels over a single TCP connection. It basically allows full-duplex communication between clients and server.
Although tomcat 7 supports them, nginx (the reverse proxy) need some further configuration for support ws:// and wss:// (SSL Websocket)
Updated by Massimiliano Assante almost 10 years ago
url for testing: wss://next.d4science.org/workspace-6.14.0-SNAPSHOT/downloadfolder
Updated by Andrea Dell'Amico almost 10 years ago
RIght now the situation is the following:
- haproxy already transparently manages the websocket connections
- nginx needs a couple of options that are
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
Those options cannot be globally set, so we need to find a way to not rewrite the nginx virtualhost every time an app activates the websockets.
Updated by Andrea Dell'Amico almost 10 years ago
- Status changed from New to In Progress
Updated by Andrea Dell'Amico almost 10 years ago
- Status changed from In Progress to Feedback
- % Done changed from 0 to 100
I've possibly found a generic solution. Now running on dev2.d4science.org.
The details:
map $http_upgrade $connection_upgrade {
default upgrade;
'' close;
}
sets the variable if the client sent the header, empty otherwise. Then, in the virtualhost reverse proxy configuration:
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
Updated by Massimiliano Assante almost 10 years ago
so far so good, but I'll wait some days and more testing to close the task
Updated by Andrea Dell'Amico almost 10 years ago
- Status changed from Feedback to Closed
Also verified on the rstudio servers.