When you access a website on an ECS instance from a browser on an on-premises device or another ECS instance, you can connect using http://<website-domain-name> but receive an "ERR_CONNECTION_TIMED_OUT" error when using https://<website-domain-name>. This topic describes how to resolve this issue.
Problem
When you use a browser on an on-premises device or another ECS instance to access your website, you can access the non-encrypted URL (http://<website-domain-name>) but cannot connect to the HTTPS-encrypted URL (https://<website-domain-name>), and you receive an "ERR_CONNECTION_TIMED_OUT" error.
In this scenario, http-to-https redirection is not configured in the website configuration file.
The symptoms are as follows:
-
Accessing the website over
http://<website-domain-name>works correctly. -
Accessing the website over
https://<website-domain-name>fails, and the browser displays anERR_CONNECTION_TIMED_OUTerror.
Cause
Web browsers use port 80 for HTTP traffic and port 443 for HTTPS traffic by default. This error can occur when the HTTPS service is running correctly on your server, but the instance's security group has no rule that allows inbound traffic on port 443. Without this rule, the server cannot receive HTTPS requests, even if HTTP requests on port 80 are working.
Solution
To resolve this issue, go to the ECS console and add an inbound rule to the ECS instance's security group to allow traffic on port 443.
-
Add a security group rule.
For detailed instructions, see Add a security group rule. On the Inbound tab, add a rule with the following settings: set the action to Allow, priority to 1, protocol type to Custom TCP, port range to HTTPS (443), and source to
0.0.0.0/0. You can add a description such as "Allow inbound traffic on port 443". -
Try to access the website again by using
https://<website-domain-name>.If you can access the website, the issue is resolved. A lock icon in your browser's address bar indicates a secure HTTPS connection.