I have set up a Remote Desktop Services Gateway behind an AWS ALB.
The AWS ALB does the SSL offloading and talks to the RDS Gateway Server via HTTP (port 80).
The configuration works and I can RDP to instances behind the RDS Gateway, but very often (every 15-20 minutes I would say on average) the RDP session spends a few seconds (5-10) reconnecting.
Does the ALB have issues with very long connections spanning several minutes? Which are possible root causes for such frequent reconnections?
** UPDATE WITH MORE DETAILED INFORMATION **
The Idle timeout of the ALB is set to 4000 seconds.
The setup seems to work fine for Windows RD clients (no reconnections in this case).
However, with a Microsoft RD for Mac client 10.3.9 (1767) running on Catalina 10.15.3, we experience frequent reconnects (every 5 to 20 minutes) and occasional freezes.
The Microsoft RD for Mac client log at /var/log/systemd.log does not report anything special when a reconnect occurs.
The IIS log at the RDS Gateway machine does not report anything special either (it does not seem to log the RDG_IN_DATA and RDG_OUT_DATA). It only logs the ELB status check and occasional rogue visits to the ALB.
The AWS ALB log sent to S3 does report a sequence of RDG_OUT_DATA and RDG_IN_DATA at the time of the reconnection. The first one is a RDG_OUT_DATA with a 200 status code and sizeable received bytes quantity, followed by two RDG_OUT_DATA with a 401 status code, then two RDG_IN_DATA with a 401 status code and finally a RDG_IN_DATA in with 200 status code until the next reconnection occurs.
If the Mac client is used directly against a RDS Gateway with no AWS in between then it works fine (no reconnections/freezes every 5 to 20 minutes).