diff --git a/app/Actions/Proxy/CheckProxySettingsInSync.php b/app/Actions/Proxy/CheckProxySettingsInSync.php index 0ffbff74b..e4d565bc1 100644 --- a/app/Actions/Proxy/CheckProxySettingsInSync.php +++ b/app/Actions/Proxy/CheckProxySettingsInSync.php @@ -8,13 +8,13 @@ class CheckProxySettingsInSync { - public function __invoke(Server $server) + public function __invoke(Server $server, bool $reset = false) { $proxy_path = config('coolify.proxy_config_path'); $output = instantRemoteProcess([ "cat $proxy_path/docker-compose.yml", ], $server, false); - if (is_null($output)) { + if (is_null($output) || $reset) { $final_output = Str::of(getProxyConfiguration($server))->trim()->value; } else { $final_output = Str::of($output)->trim()->value; diff --git a/app/Http/Livewire/Server/Proxy.php b/app/Http/Livewire/Server/Proxy.php index 94b331495..22d4e8496 100644 --- a/app/Http/Livewire/Server/Proxy.php +++ b/app/Http/Livewire/Server/Proxy.php @@ -65,7 +65,7 @@ public function saveConfiguration() public function checkProxySettingsInSync() { try { - $this->proxy_settings = resolve(CheckProxySettingsInSync::class)($this->server); + $this->proxy_settings = resolve(CheckProxySettingsInSync::class)($this->server, true); } catch (\Exception $e) { return generalErrorHandler($e); } diff --git a/app/Jobs/DeployApplicationJob.php b/app/Jobs/DeployApplicationJob.php index 31159d2df..71c965fac 100644 --- a/app/Jobs/DeployApplicationJob.php +++ b/app/Jobs/DeployApplicationJob.php @@ -17,6 +17,7 @@ use Spatie\Activitylog\Models\Activity; use Symfony\Component\Yaml\Yaml; use Illuminate\Support\Str; +use Spatie\Url\Url; class DeployApplicationJob implements ShouldQueue { @@ -376,8 +377,10 @@ private function set_labels_for_applications() $labels[] = 'coolify.type=application'; $labels[] = 'coolify.name=' . $this->application->name; if ($this->application->fqdn) { + $url = Url::fromString($this->application->fqdn); + $host = $url->getHost(); $labels[] = 'traefik.enable=true'; - $labels[] = "traefik.http.routers.container.rule=Host(`{$this->application->fqdn}`)"; + $labels[] = "traefik.http.routers.container.rule=Host(`{$host}`)"; } return $labels; } diff --git a/resources/views/livewire/server/proxy.blade.php b/resources/views/livewire/server/proxy.blade.php index 3487b57e4..2ce8d85b8 100644 --- a/resources/views/livewire/server/proxy.blade.php +++ b/resources/views/livewire/server/proxy.blade.php @@ -41,6 +41,9 @@ wire:click.prevent="installProxy"> Apply + + Default + @endisset