Check scheme, host, and port and make logic correct