2023-07-28 11:31:47 +00:00
|
|
|
<div>
|
2023-10-11 09:00:40 +00:00
|
|
|
@if (data_get($server, 'proxy.type'))
|
|
|
|
<div x-init="$wire.loadProxyConfiguration">
|
2024-03-11 14:08:05 +00:00
|
|
|
@if ($selectedProxy !== 'NONE')
|
2023-12-07 18:06:32 +00:00
|
|
|
<form wire:submit='submit'>
|
2023-10-11 09:00:40 +00:00
|
|
|
<div class="flex items-center gap-2">
|
|
|
|
<h2>Configuration</h2>
|
|
|
|
@if ($server->proxy->status === 'exited')
|
|
|
|
<x-forms.button wire:click.prevent="change_proxy">Switch Proxy</x-forms.button>
|
2024-03-11 14:08:05 +00:00
|
|
|
@else
|
|
|
|
<x-forms.button disabled wire:click.prevent="change_proxy">Switch Proxy</x-forms.button>
|
2023-06-23 12:35:13 +00:00
|
|
|
@endif
|
2024-03-11 14:08:05 +00:00
|
|
|
<x-forms.button type="submit">Save</x-forms.button>
|
|
|
|
|
2023-10-11 09:00:40 +00:00
|
|
|
</div>
|
2024-03-11 14:19:04 +00:00
|
|
|
<div class="pb-4 ">Before switching proxies, please read <a href="https://coolify.io/docs/server/switching-proxies">this</a>.</div>
|
2024-03-11 14:08:05 +00:00
|
|
|
@if ($server->proxyType() === 'TRAEFIK_V2')
|
|
|
|
<div class="pb-4">Traefik v2</div>
|
|
|
|
@elseif ($server->proxyType() === 'CADDY')
|
|
|
|
<div class="pb-4 ">Caddy</div>
|
|
|
|
@endif
|
2023-10-11 09:00:40 +00:00
|
|
|
@if (
|
|
|
|
$server->proxy->last_applied_settings &&
|
|
|
|
$server->proxy->last_saved_settings !== $server->proxy->last_applied_settings)
|
|
|
|
<div class="text-red-500 ">Configuration out of sync. Restart the proxy to apply the new
|
|
|
|
configurations.
|
2023-06-23 12:35:13 +00:00
|
|
|
</div>
|
2023-10-11 09:00:40 +00:00
|
|
|
@endif
|
2024-03-11 14:08:05 +00:00
|
|
|
@if ($server->proxyType() === 'TRAEFIK_V2')
|
|
|
|
<x-forms.input placeholder="https://app.coolify.io" id="redirect_url"
|
|
|
|
label="Default Redirect 404"
|
|
|
|
helper="All urls that has no service available will be redirected to this domain." />
|
|
|
|
@endif
|
2023-10-11 09:00:40 +00:00
|
|
|
<div wire:loading wire:target="loadProxyConfiguration" class="pt-4">
|
|
|
|
<x-loading text="Loading proxy configuration..." />
|
2023-09-06 13:00:56 +00:00
|
|
|
</div>
|
2023-10-11 09:00:40 +00:00
|
|
|
<div wire:loading.remove wire:target="loadProxyConfiguration">
|
|
|
|
@if ($proxy_settings)
|
2024-03-04 09:46:53 +00:00
|
|
|
<div class="flex flex-col gap-2 pt-4">
|
2024-03-11 14:08:05 +00:00
|
|
|
<x-forms.textarea label="Configuration file" name="proxy_settings"
|
2023-12-07 18:06:32 +00:00
|
|
|
wire:model="proxy_settings" rows="30" />
|
2023-10-11 09:00:40 +00:00
|
|
|
<x-forms.button wire:click.prevent="reset_proxy_configuration">
|
|
|
|
Reset configuration to default
|
|
|
|
</x-forms.button>
|
|
|
|
</div>
|
|
|
|
@endif
|
2023-09-25 07:17:42 +00:00
|
|
|
</div>
|
2023-10-11 09:00:40 +00:00
|
|
|
</form>
|
|
|
|
@elseif($selectedProxy === 'NONE')
|
|
|
|
<div class="flex items-center gap-2">
|
|
|
|
<h2>Configuration</h2>
|
|
|
|
<x-forms.button wire:click.prevent="change_proxy">Switch Proxy</x-forms.button>
|
|
|
|
</div>
|
2024-03-11 14:08:05 +00:00
|
|
|
<div class="pt-2 pb-4">Custom (None) Proxy Selected</div>
|
2023-08-11 18:19:42 +00:00
|
|
|
@else
|
2023-10-11 09:00:40 +00:00
|
|
|
<div class="flex items-center gap-2">
|
|
|
|
<h2>Configuration</h2>
|
|
|
|
<x-forms.button wire:click.prevent="change_proxy">Switch Proxy</x-forms.button>
|
|
|
|
</div>
|
|
|
|
@endif
|
|
|
|
@else
|
|
|
|
<div>
|
|
|
|
<h2>Configuration</h2>
|
|
|
|
<div class="subtitle">Select a proxy you would like to use on this server.</div>
|
|
|
|
<div class="grid gap-4">
|
|
|
|
<x-forms.button class="box" wire:click="select_proxy('NONE')">
|
|
|
|
Custom (None)
|
|
|
|
</x-forms.button>
|
|
|
|
<x-forms.button class="box" wire:click="select_proxy('TRAEFIK_V2')">
|
|
|
|
Traefik
|
|
|
|
</x-forms.button>
|
2024-03-11 14:08:05 +00:00
|
|
|
<x-forms.button class="box" wire:click="select_proxy('CADDY')">
|
|
|
|
Caddy (experimental)
|
2023-10-11 09:00:40 +00:00
|
|
|
</x-forms.button>
|
|
|
|
<x-forms.button disabled class="box">
|
2024-03-11 14:08:05 +00:00
|
|
|
Nginx
|
2023-10-11 09:00:40 +00:00
|
|
|
</x-forms.button>
|
2023-08-11 18:19:42 +00:00
|
|
|
</div>
|
2023-10-11 09:00:40 +00:00
|
|
|
</div>
|
2023-08-11 18:19:42 +00:00
|
|
|
@endif
|
|
|
|
</div>
|