refactor(server): simplify proxy path logic and remove unnecessary conditions
This commit is contained in:
@@ -486,19 +486,13 @@ $schema://$host {
|
|||||||
$base_path = config('constants.coolify.base_config_path');
|
$base_path = config('constants.coolify.base_config_path');
|
||||||
$proxyType = $this->proxyType();
|
$proxyType = $this->proxyType();
|
||||||
$proxy_path = "$base_path/proxy";
|
$proxy_path = "$base_path/proxy";
|
||||||
// TODO: should use /traefik for already existing configurations?
|
|
||||||
// Should move everything except /caddy and /nginx to /traefik
|
|
||||||
// The code needs to be modified as well, so maybe it does not worth it
|
|
||||||
if ($proxyType === ProxyTypes::TRAEFIK->value) {
|
if ($proxyType === ProxyTypes::TRAEFIK->value) {
|
||||||
// Do nothing
|
$proxy_path = '/';
|
||||||
} elseif ($proxyType === ProxyTypes::CADDY->value) {
|
} elseif ($proxyType === ProxyTypes::CADDY->value) {
|
||||||
$proxy_path = $proxy_path.'/caddy';
|
$proxy_path = $proxy_path.'/caddy';
|
||||||
} elseif ($proxyType === ProxyTypes::NGINX->value) {
|
} elseif ($proxyType === ProxyTypes::NGINX->value) {
|
||||||
if (isDev()) {
|
$proxy_path = $proxy_path.'/nginx';
|
||||||
$proxy_path = '/var/lib/docker/volumes/coolify_dev_coolify_data/_data/proxy/nginx';
|
|
||||||
} else {
|
|
||||||
$proxy_path = $proxy_path.'/nginx';
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return $proxy_path;
|
return $proxy_path;
|
||||||
|
|||||||
Reference in New Issue
Block a user