2024-08-07 15:52:51 +00:00
@ php use App\Enums\ProxyTypes ; @ endphp
2023-07-28 11:31:47 +00:00
< div >
2024-03-12 11:45:55 +00:00
@ if ( $server -> proxyType ())
2023-10-11 09:00:40 +00:00
< 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' >
2025-09-22 07:54:29 +00:00
< div class = " flex items-center gap-2 " >
< h2 > Configuration </ h2 >
@ if ( $server -> proxy -> status === 'exited' || $server -> proxy -> status === 'removing' )
@ can ( 'update' , $server )
< x - modal - confirmation title = " Confirm Proxy Switching? " buttonTitle = " Switch Proxy "
submitAction = " changeProxy " : actions = " ['Custom proxy configurations may be reset to their default settings.'] "
warningMessage = " This operation may cause issues. Please refer to the guide <a href='https://coolify.io/docs/knowledge-base/server/proxies#switch-between-proxies' target='_blank' class='underline text-white'>switching between proxies</a> before proceeding! "
step2ButtonText = " Switch Proxy " : confirmWithText = " false " : confirmWithPassword = " false " >
</ x - modal - confirmation >
@ endcan
@ else
< x - forms . button canGate = " update " : canResource = " $server "
wire : click = " $dispatch ('error', 'Currently running proxy must be stopped before switching proxy') " > Switch
Proxy </ x - forms . button >
@ endif
< x - forms . button canGate = " update " : canResource = " $server " type = " submit " > Save </ x - forms . button >
</ div >
< div class = " subtitle " > Configure your proxy settings and advanced options .</ div >
< h3 > Advanced </ h3 >
2025-09-21 18:45:02 +00:00
< div class = " pb-6 w-96 " >
2025-08-26 08:27:31 +00:00
< x - forms . checkbox canGate = " update " : canResource = " $server "
2024-08-07 16:27:50 +00:00
helper = " If set, all resources will only have docker container labels for { { str( $server->proxyType ())->title() }}.<br>For applications, labels needs to be regenerated manually. <br>Resources needs to be restarted. "
id = " server.settings.generate_exact_labels "
label = " Generate labels only for { { str( $server->proxyType ())->title() }} " instantSave />
2025-08-26 08:27:31 +00:00
< x - forms . checkbox canGate = " update " : canResource = " $server " instantSave = " instantSaveRedirect "
2025-09-09 10:52:19 +00:00
id = " redirectEnabled " label = " Override default request handler "
2025-07-18 13:00:49 +00:00
helper = " Requests to unknown hosts or stopped services will receive a 503 response or be redirected to the URL you set below (need to enable this first). " />
2025-09-09 10:52:19 +00:00
@ if ( $redirectEnabled )
2025-08-26 08:27:31 +00:00
< x - forms . input canGate = " update " : canResource = " $server " placeholder = " https://app.coolify.io "
2025-09-09 10:52:19 +00:00
id = " redirectUrl " label = " Redirect to (optional) " />
2024-10-10 15:44:52 +00:00
@ endif
</ div >
2025-09-22 07:54:29 +00:00
@ php
$proxyTitle =
$server -> proxyType () === ProxyTypes :: TRAEFIK -> value
? 'Traefik (Coolify Proxy)'
: 'Caddy (Coolify Proxy)' ;
@ endphp
@ if ( $server -> proxyType () === ProxyTypes :: TRAEFIK -> value || $server -> proxyType () === 'CADDY' )
< div class = " flex items-center gap-2 " >
< h3 > {{ $proxyTitle }} </ h3 >
@ if ( $proxySettings )
@ can ( 'update' , $server )
< x - modal - confirmation title = " Reset Proxy Configuration? "
buttonTitle = " Reset Configuration " submitAction = " resetProxyConfiguration "
: actions = " [
'Reset proxy configuration to default settings' ,
'All custom configurations will be lost' ,
'Custom ports and entrypoints will be removed' ,
] " confirmationText= " {{ $server -> name }} "
confirmationLabel = " Please confirm by entering the server name below "
shortConfirmationLabel = " Server Name " step2ButtonText = " Reset Configuration "
: confirmWithPassword = " false " : confirmWithText = " true " >
</ x - modal - confirmation >
@ endcan
@ endif
</ 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
< 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 " >
2025-09-09 10:52:19 +00:00
@ if ( $proxySettings )
2025-09-22 07:54:59 +00:00
< div class = " flex flex-col gap-2 pt-2 " >
2025-08-26 08:27:31 +00:00
< x - forms . textarea canGate = " update " : canResource = " $server " useMonacoEditor
2025-09-09 10:52:19 +00:00
monacoEditorLanguage = " yaml "
2025-09-22 07:54:29 +00:00
label = " Configuration file ( { { $this->configurationFilePath }} ) "
name = " proxySettings " id = " proxySettings " rows = " 30 " />
2023-10-11 09:00:40 +00:00
</ 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 >
2025-08-26 08:27:31 +00:00
@ can ( 'update' , $server )
< x - forms . button wire : click . prevent = " changeProxy " > Switch Proxy </ x - forms . button >
@ endcan
2023-10-11 09:00:40 +00:00
</ 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 >
2025-08-26 08:27:31 +00:00
@ can ( 'update' , $server )
< x - forms . button wire : click . prevent = " changeProxy " > Switch Proxy </ x - forms . button >
@ endcan
2023-10-11 09:00:40 +00:00
</ div >
@ endif
@ else
< div >
< h2 > Configuration </ h2 >
< div class = " subtitle " > Select a proxy you would like to use on this server .</ div >
2025-08-26 08:27:31 +00:00
@ can ( 'update' , $server )
< div class = " grid gap-4 " >
< x - forms . button class = " box " wire : click = " selectProxy('NONE') " >
Custom ( None )
</ x - forms . button >
< x - forms . button class = " box " wire : click = " selectProxy('TRAEFIK') " >
Traefik
</ x - forms . button >
< x - forms . button class = " box " wire : click = " selectProxy('CADDY') " >
Caddy
</ x - forms . button >
{{ -- < x - forms . button disabled class = " box " >
Nginx
</ x - forms . button > -- }}
</ div >
@ else
2025-09-25 09:14:56 +00:00
< x - callout type = " warning " title = " Permission Required " class = " mb-4 " >
2025-08-26 08:27:31 +00:00
You don ' t have permission to configure proxy settings for this server .
2025-09-25 09:14:56 +00:00
</ x - callout >
2025-08-26 08:27:31 +00:00
@ endcan
2023-10-11 09:00:40 +00:00
</ div >
2023-08-11 18:19:42 +00:00
@ endif
</ div >