Skip to content

Instantly share code, notes, and snippets.

@Decicus
Last active December 31, 2023 16:34
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Decicus/085692d927a0ea9751dffe10337331a9 to your computer and use it in GitHub Desktop.
Save Decicus/085692d927a0ea9751dffe10337331a9 to your computer and use it in GitHub Desktop.
NGINX alias for mapping Let's Encrypt "webroot" challenge to one directory
# Just an example, but basically you'd save this under something like `/etc/nginx/letsencrypt.conf`
# Then inside your configuration for your website inside the `server` block, you'd also do: `include letsencrypt.conf`
# Reload/restart NGINX config, then request a certificate and point the webroot to `/var/www/html` (or whatever else you changed it to, if you did).
location /.well-known/acme-challenge {
# Change `/var/www/html` to something that makes sense for your configuration.
# Just make sure to use the correct directory when using webroot challenge, if you do end up changing it.
alias /var/www/html/.well-known/acme-challenge;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment