Update service environment variables

This commit is contained in:
Andras Bacsai
2024-03-13 09:27:42 +01:00
parent 73e9410264
commit 2f1a7f8f40
12 changed files with 61 additions and 60 deletions

View File

@@ -240,21 +240,12 @@ function fqdnLabelsForCaddy(string $network, string $uuid, Collection $domains,
$labels->push("caddy_{$loop}.header=-Server");
$labels->push("caddy_{$loop}.try_files={path} /index.html /index.php");
if ($serviceLabels) {
if ($port) {
$labels->push("caddy_{$loop}.reverse_proxy={{upstreams $port}}");
} else {
$labels->push("caddy_{$loop}.reverse_proxy={{upstreams}}");
}
if ($port) {
$labels->push("caddy_{$loop}.handle_path.{$loop}_reverse_proxy={{upstreams $port}}");
} else {
if ($port) {
$labels->push("caddy_{$loop}.handle_path.{$loop}_reverse_proxy={{upstreams $port}}");
} else {
$labels->push("caddy_{$loop}.handle_path.{$loop}_reverse_proxy={{upstreams}}");
}
$labels->push("caddy_{$loop}.handle_path={$path}*");
$labels->push("caddy_{$loop}.handle_path.{$loop}_reverse_proxy={{upstreams}}");
}
$labels->push("caddy_{$loop}.handle_path={$path}*");
if ($is_gzip_enabled) {
$labels->push("caddy_{$loop}.encode=zstd gzip");
}