Nginx Wildcard Subdomains for Multi-Tenancy (ssl + better config)

Опубликовано: 29 Сентябрь 2024
на канале: Chris Fidao
2,934
128

We use letsencrypt (certbot) with the CloudFlare DNS plugin to generate a fee, auto-renewing TLS certificate to use with Nginx.

Then we configure Nginx to use that TLS certificate and create a configuration to support multi-tenancy in our applications.

We use a special configuration to capture the value of the subdomain so we can pass it off to our PHP application (or do anything we want, like use dynamic app locations for local development - as described here:    • Local dev setup for multi-tenant appl...   ).

► Useful Links:

Install certbot: https://certbot.eff.org/
Certbot challenge types: https://letsencrypt.org/docs/challeng...
My site: fideloper.com
My newsletter: https://fideloper.ck.page/

⌚️ Timestamps

00:00 What we'll do
00:35 Certbot + Cloudflare setup
01:28 Cloudflare API Credentials
02:02 Generating the wildcard certificate
03:47 OK Nginx Config
06:05 Better Nginx Config
08:17 Another Trick