Unlimited subdomain app with CloudFlare, SSL, load balancer, Forge

Posted 2 months ago by itinerix

Hi all,

I have an app "myapp.com" with customers in subdomains such as "ABC.myapp.com", "XYZ.myapp.com", etc. So "ABC" or "XYZ" can be anything, user-defined, and in unlimited numbers.

Locally... Laravel and Valet make it easy to handle, and it works beautifully.

On the server... is where my challenge is. My settings:


  • DNS: "A" record "myapp.com" points to the load balancer's IP address "A" record "*" points to the same
  • Crypto: Free wildcard SSL certificate, set to Full


  • Load balancer on "*.myapp.com" pointing to myapp's sever and with the SSL cert from Cloudflare installed
  • myapp server running myapp's code, installed as site "*.myapp.com"

In the browser, going to "myapp.com" works great. However "XYZ.myapp.com" isn't working and returns "NET::ERR_CERT_AUTHORITY_INVALID"

Any pointers much appreciated!

Please sign in or create an account to participate in this conversation.