mirror of
https://github.com/vitodeploy/vito.git
synced 2025-07-05 07:52:34 +00:00
reverse proxy basics (#609)
This commit is contained in:
@ -8,17 +8,21 @@
|
||||
import access_log {{ $site->domain }}
|
||||
import compression
|
||||
import security_headers
|
||||
@if ($site->type()->language() === '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
|
||||
@if ($site->port)
|
||||
reverse_proxy 127.0.0.1:{{ $site->port }}
|
||||
@else
|
||||
@if ($site->type()->language() === '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
|
||||
@endif
|
||||
@endif
|
||||
@if ($site->type === \App\Enums\SiteType::LOAD_BALANCER)
|
||||
reverse_proxy {
|
||||
@ -44,4 +48,4 @@
|
||||
}
|
||||
@endif
|
||||
@include('ssh.services.webserver.caddy.redirects', ['site' => $site])
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user