Hello,
I have a setup of network load balancer fronting some ec2 instances containing my websocket server. I have created a CloudFront distribution pointing to this NLB. With the intention that clients(IoT devices) from the internet can initiate websocket connections with my server. I have setup the required headers(as defined here) in the "Behavior" part of my CF distribution. And i created a subdomain (e.g. gateway.abc.com), created certificate in ACM and linked it to CF distribution as an alternate domain name. My domain is hosted in bluehost, i have added the CNAME records provided during certificate creation to my DNS server.
My problem is when my IoT devices try to connect via the distribution endpoint (ddgdsgdfg.cloudfront.net), the connections are successful and connecting to my websocket server (i am initiating ws connections NOT wss). However, if i try the same with the alternate domain name i provided, it is not working (gateway.abc.com). What am i missing? ideally i would want to use my subdomain instead of the CF endpoint. I would appreciate any pointers. Also CF logs are not helpful and unfortunately i cannot check the IoT device logs.
Could you share the error that the IoT devices throw when trying to establish the ws using your domain? that should shed some light in the issue.