This commit is contained in:
azlux 2025-01-25 11:46:37 +00:00 committed by GitHub
commit 68eb8065f4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 5 additions and 0 deletions

View file

@ -844,6 +844,8 @@ docker run --detach \
--volume /path/to/custom-vhost-config.conf:/etc/nginx/vhost.d/app.example.com:ro \
nginxproxy/nginx-proxy
```
#### Per-VIRTUAL_HOST http location
To add settings on a per-`VIRTUAL_HOST` basis but for the http part, add your configuration file under `/etc/nginx/vhost.d` just like the previous section except with the suffix `_http`. This allow you to add configuration before the https redirection like the acme challenge. This is mostly usefull for all others 'not supporting https redirect' `.well-known` URIs.
</details>

View file

@ -891,6 +891,9 @@ server {
{{- if $globals.config.enable_ipv6 }}
listen [::]:{{ $globals.config.external_http_port }} {{ $default_server }};
{{- end }}
{{- if (exists (printf "/etc/nginx/vhost.d/%s_http" $host)) }}
include {{ printf "/etc/nginx/vhost.d/%s_http" $host }};
{{- end }}
{{- if (or $vhost.acme_http_challenge_legacy $vhost.acme_http_challenge_enabled) }}
# Do not HTTPS redirect Let's Encrypt ACME challenge