Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

jcodes's avatar

Custom domains with SSL on DO/Forge

I have deployed an app using forge - the app resides multi tenancy with custom domain/subdomain option for users.

To allow custom domains to be served from the same code base, I have updated server name as below: server_name ~^(?.*)$;

The custom subdomains are now reaching but SSL is not being issued for those custom domains. Can someone help me with:

  1. How a wildcard SSL for custom domains
  2. How to set rule from within Forge to direct all traffic from http to https

Thanks for all the help

0 likes
1 reply
viedev's avatar

I don't have Forge specific advice, but to get a wildcard SSL cert you need:

  • Either to buy a wildcard cert from a provider, and configure your server to use it;
  • Or something like Caddy or Certbot that can automate renewing LetsEncrypt/other wildcard certs
  • If you automate it, the software doing the automating needs to be able to integrate with your DNS provider, since wildcard certs now require DNS verification. This usually looks like configuring some API keys into the software that your DNS provider offers you.

Alternatively, there are services like https://approximated.app (I'm the founder) that can handle custom domain certs and routing for you if you'd prefer a paid solution.

Please or to participate in this conversation.