Custom Nginx Configuration

How to add your own nginx directives to a Waddle project in nginx/conf/extras/, and how Waddle uses that directory to request Let's Encrypt certificates.

Every Waddle project’s nginx server block includes one wildcard line near the top:

include "nginx/conf/extras/*.conf";

nginx/conf/extras/ is empty by default. It exists so you have somewhere to add your own directives, extra location blocks, headers, redirects, anything server-context, without touching the platform’s own rendered config file in nginx/conf/conf.d/. That file is regenerated by Waddle whenever platform-related settings change, so anything you add there directly is at risk of being overwritten. A .conf file dropped into extras/ instead is never touched by Waddle and is picked up automatically on the next container start, no rebuild needed.

The Let’s Encrypt certificate directive

If you enable Let’s Encrypt for a remote, Waddle writes one more file into this same directory on that remote: nginx/conf/extras/00-waddle-acme.conf, containing a single line naming the domain to request a certificate for.

That file is written by Waddle itself, separately for every remote, every time you push or deploy to it. It isn’t part of your project’s git repository, and you won’t see it locally, it only exists on remotes that have Let’s Encrypt turned on. This is necessary because the nginx module that requests the certificate only accepts one such directive per site, naming one fixed domain; it can’t be written once to cover every environment. Instead, each remote gets its own copy, naming only its own domain, so that a problem obtaining a certificate for one remote (for example, one that’s temporarily offline) never affects any other.

Turning Let’s Encrypt off for a remote removes the file on the next push, and locally nginx falls back to a self-signed development certificate instead, so https://yourproject.localhost keeps working without ever requesting one.

A word of caution

Because 00-waddle-acme.conf is regenerated by Waddle on every push, don’t create a file of your own with that exact name in extras/, it will be silently replaced.