Cypress gets 404 on Render subdomains

I have a peculiar issue, where my tests are failing only on Render subdomains.

I’ve created a Github action, which triggers Cypress to run end-to-end tests on our app. For some reason, this results in a 404, even though the app is perfectly alive and accessible during normal browsing.

I’ve narrowed it down to affect only subdomains hosted on Render, e.g. app.mydomain.com and differentapp.mydomain.com.

The tests run fine if:

  • I set the URL to be the top domain (i.e. mydomain.com) or a subdomain not hosted on Render (e.g. app.differentdomain.com).
  • I access the underlying URL, e.g. app-mydomain.onrender.com.
  • I run the same tests locally

As far as I can see, the DNS is set up correctly, with a CNAME record pointing to the subdomain, as outlined in the documentation.

Considering it’s actually a 404, and not a timeout, it seems the app is actually hitting a gateway (or something) which then immediately returns 404.

Where do I go from here?

Hi @nixstrom, if you are using subdomains, you’ll need to configure a wildcard custom domain: Custom Domains | Render · Cloud Hosting for Developers. This will require you to add 2 CNAME records to your DNS settings - one for the wildcard and a second _acme-challenge one.