Net-err-cert-common-name-invalid-

Firefox can't establish a connection to the server at wss://ec2-52-91-146-176.compute-1.amazonaws.com/.

So this is your backend, right?

Whatever secure websocket connection you make, the certificate needs to match the hostname in the URI.

You won't be able to issue a certificate for an amazonaws.com domain, so I suggest:

  1. Create backend.azma.io in your DNS and point it at your EC2 intstance
  2. Issue a certificate for backend.azma.io and configure nginx with it
  3. Configure your static app to connect to wss://backend.azma.io instead.
  4. You might have to configure some CORS headers on nginx, to allow https://azma.io to connect to wss://backend.azma.io. I'm not sure how cross-origin rules apply to websockets tbh.