mirror of
https://github.com/vitodeploy/vito.git
synced 2025-07-04 15:32:35 +00:00
Plugins base (#613)
* wip * wip * cleanup * notification channels * phpstan * services * remove server types * refactoring * refactoring
This commit is contained in:
@ -0,0 +1,5 @@
|
||||
#[core]
|
||||
import access_log {{ $site->domain }}
|
||||
import compression
|
||||
import security_headers
|
||||
#[/core]
|
@ -0,0 +1,5 @@
|
||||
#[force-ssl]
|
||||
@if ($site->activeSsl && $site->force_ssl)
|
||||
redir @http https://{host}{uri} permanent
|
||||
@endif
|
||||
#[/force-ssl]
|
@ -0,0 +1,23 @@
|
||||
#[load-balancer]
|
||||
reverse_proxy {
|
||||
@if ($site->loadBalancerServers()->count() > 0)
|
||||
@foreach($site->loadBalancerServers as $server)
|
||||
to {{ $server->ip }}:{{ $server->port }}
|
||||
@endforeach
|
||||
@else
|
||||
to 127.0.0.1
|
||||
@endif
|
||||
@switch($site->type_data['method'] ?? LoadBalancerMethod::ROUND_ROBIN)
|
||||
@case(LoadBalancerMethod::LEAST_CONNECTIONS)
|
||||
lb_policy least_conn
|
||||
@break
|
||||
@case(LoadBalancerMethod::IP_HASH)
|
||||
lb_policy ip_hash
|
||||
@break
|
||||
@default
|
||||
lb_policy round_robin
|
||||
@endswitch
|
||||
header_up Host {host}
|
||||
header_up X-Real-IP {remote}
|
||||
}
|
||||
#[/load-balancer]
|
@ -0,0 +1,12 @@
|
||||
#[php]
|
||||
root * {{ $site->getWebDirectoryPath() }}
|
||||
@php
|
||||
$phpSocket = "unix//var/run/php/php{$site->php_version}-fpm.sock";
|
||||
if ($site->isIsolated()) {
|
||||
$phpSocket = "unix//run/php/php{$site->php_version}-fpm-{$site->user}.sock";
|
||||
}
|
||||
@endphp
|
||||
try_files {path} {path}/ /index.php?{query}
|
||||
php_fastcgi {{ $phpSocket }}
|
||||
file_server
|
||||
#[/php]
|
@ -0,0 +1,5 @@
|
||||
#[port]
|
||||
@if ($site->activeSsl)
|
||||
tls {{ $site->activeSsl->certificate_path }} {{ $site->activeSsl->pk_path }}
|
||||
@endif
|
||||
#[/port]
|
@ -0,0 +1,7 @@
|
||||
#[redirects]
|
||||
@foreach($site->activeRedirects as $redirect)
|
||||
location = {{ $redirect->from }} {
|
||||
return {{ $redirect->mode }} {{ $redirect->to }};
|
||||
}
|
||||
@endforeach
|
||||
#[/redirects]
|
Reference in New Issue
Block a user