RStudio Workbench / RStudio Server Pro behind an AWS Classic Load Balancer


Many organizations run RStudio Professional Products on AWS and wish to load balance instances with AWS ELBs. We recommend using a load balancer other than AWS Classic ELBs if possible. There are several different load balancers available in AWS, and an option that natively supports websockets is a better choice than the Classic Load Balancer.

RStudio Workbench (previously RStudio Server Pro) uses websockets, a protocol for extended two-way communication between two hosts, for running Jupyter notebooks, Shiny apps, and more. Websockets are not natively supported by AWS Classic ELBs.

It is possible to enable websockets in AWS Classic ELBs by switching the Load Balancer Protocol to SSL and the Instance Protocol to TCP. We do not recommend this path because AWS Classic ELBs do not send appropriate headers when using TCP, and users will not be properly redirected, for example, when logging in or out.

Savvy network administrators may be able to design workarounds to this problem, but our primary recommendation is to use a different type of load balancer that natively supports websockets with RStudio Professional Products.

If you still wish to use an AWS Classic ELB, the problematic headers are the X-Forwarded-* headers, specifically X-Forwarded-Proto.