docs: add note on vhost.d files with acme-companion

This commit is contained in:
Rémi Berthoz 2022-08-15 12:53:14 +02:00 committed by GitHub
parent c4ad18fecc
commit 653563f7a1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -431,10 +431,14 @@ If you are using multiple hostnames for a single container (e.g. `VIRTUAL_HOST=e
ln -s /path/to/vhost.d/www.example.com /path/to/vhost.d/example.com ln -s /path/to/vhost.d/www.example.com /path/to/vhost.d/example.com
``` ```
**NOTE**: If you use the [acme-companion](https://github.com/nginx-proxy/acme-companion) companion container, configuration files mounted in `/etc/nginx/vhost.d` will be appended by the container. Appended files contain an extra location, for ACME challenges, that should be left as-is.
#### Per-VIRTUAL_HOST default configuration #### Per-VIRTUAL_HOST default configuration
If you want most of your virtual hosts to use a default single configuration and then override on a few specific ones, add those settings to the `/etc/nginx/vhost.d/default` file. This file will be used on any virtual host which does not have a `/etc/nginx/vhost.d/{VIRTUAL_HOST}` file associated with it. If you want most of your virtual hosts to use a default single configuration and then override on a few specific ones, add those settings to the `/etc/nginx/vhost.d/default` file. This file will be used on any virtual host which does not have a `/etc/nginx/vhost.d/{VIRTUAL_HOST}` file associated with it.
**NOTE**: If you use the [acme-companion](https://github.com/nginx-proxy/acme-companion) companion container, configuration files mounted in `/etc/nginx/vhost.d` will be appended by the container. Appended files contain an extra location, for ACME challenges, that should be left as-is.
#### Per-VIRTUAL_HOST location configuration #### Per-VIRTUAL_HOST location configuration
To add settings to the "location" block on a per-`VIRTUAL_HOST` basis, add your configuration file under `/etc/nginx/vhost.d` just like the previous section except with the suffix `_location`. To add settings to the "location" block on a per-`VIRTUAL_HOST` basis, add your configuration file under `/etc/nginx/vhost.d` just like the previous section except with the suffix `_location`.