WEM Containment Failing on BYOC Edge 502

The BYOC edge deployment is interrupting the WEM user experience flow, causing a 502 Bad Gateway error during the WebSocket handshake and forcing containment metrics to flatline. Apologies for the novice confusion, but the console is flagging a ‘Transit Gateway’ mismatch while the Architect canvas references a ‘VPC peering’ connection that doesn’t exist in the BYOC setup. The edge proxy rejects the session immediately after the TTS greeting attempts to initialize.

Are you routing the WebSocket traffic through the same subnet CIDR block that your EventBridge rule expects, or did you shift the load balancer listener to a different AZ? HTTP 502 Bad Gateway: Upstream connect error or disconnect/reset before headers. The BYOC edge proxy drops the handshake when it can’t resolve the WEM containment endpoint because the routing table is pointing at a stale VPC peering route instead of the direct Transit Gateway attachment. You’ll need to verify the edge routing config matches your actual deployment zones before you restart the proxy.

Run this quick check against the routing API to pull the active edge endpoints and confirm the internal target:

curl -s -X GET "https://api.mypurecloud.com/api/v2/routing/edges/${EDGE_ID}" \
 -H "Authorization: Bearer $GC_TOKEN" \
 -H "Accept: application/json" | jq '.endpoints[].name, .endpoints[].target'

Make sure the wem_containment target points to the internal NLB DNS name, not the public load balancer. Dropping that stale route usually fixes the handshake hang. Sometimes the NLB health check just times out on the first packet. The gateway throws a 502 immediately when the SSL certificate chain doesn’t match the internal domain.