- Mais recentes
- Mais votos
- Mais comentários
You cannot specify the port that CloudFront listens on for viewer traffic - it will always be either 80 for HTTP traffic, or 443 for HTTPS traffic. This is configured in your Behavior settings: https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/using-https-viewers-to-cloudfront.html
However, you can configure a custom origin which listens on 80, 443, or 1024-65535: https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/distribution-web-values-specify.html
In your case, rather than trying to connect to CloudFront on port 8443, you could instead create a second CloudFront distribution to use for the non-production/test traffic - eg. test.example.com, and configure a custom origin so that CloudFront accesses your ALB on port 8443.
Conteúdo relevante
- AWS OFICIALAtualizada há 2 anos
- AWS OFICIALAtualizada há um ano
- AWS OFICIALAtualizada há 2 anos
- AWS OFICIALAtualizada há 2 anos
Tried in the way explained above. But still has same problem. test.example.com request redirects to test.example.com:8443 but not reaching ALB. Trace Log for https://testportal.example.com/admin
== Info: Clear auth, redirects to port from 443 to 8443== Info: Issue another request to this URL: 'https://testportal..:8443/admin' == Info: Trying 65.8.72.94:8443... == Info: TCP_NODELAY set == Info: connect to 65.8.72.94 port 8443 failed: Connection timed out == Info: Trying 65.8.72.27:8443... == Info: TCP_NODELAY set == Info: After 84504ms connect time, move on! == Info: connect to 65.8.72.27 port 8443 failed: Connection timed out == Info: Trying 65.8.72.23:8443... == Info: TCP_NODELAY set
It looks like the viewer makes a request on port 443 which is accepted - but then a redirect is returned and the viewer tries to access CloudFront on port 8443 which is not possible. The viewer should always communicate with CloudFront on port 443 - but you can configure CloudFront to communicate with the ALB on 8443. The origin should not return a redirect to the viewer