If you happen to hit the err below, when rewriting to local server with ssl,
HTTP Error 502.3 - Bad Gateway
A security error occurred
try disabling some of the ssl security as specified here: https://docs.microsoft.com/en-us/iis/extensions/configuring-application-request-routing-arr/arr-support-added-for-winhttpoptionsecurityflags
reg.exe add "HKLM\SOFTWARE\Microsoft\IIS Extensions\Application Request Routing\Parameters" /v SecureConnectionIgnoreFlags /t REG_DWORD /d 0
and then set the value to 0x00003300