1
0
mirror of https://github.com/laravel/valet.git synced 2026-02-04 16:10:08 +01:00

load legacy config if nginx > 1.25.1

This commit is contained in:
PimPlaatsman
2023-10-09 14:11:03 +02:00
parent c66dfee102
commit bd3fe5bfcc

View File

@@ -631,8 +631,11 @@ public function buildCertificateConf(string $path, string $url): void
public function buildSecureNginxServer(string $url, string $siteConf = null): string
{
if ($siteConf === null) {
$nginxVersion = ltrim(exec('nginx -v'), 'nginx version: nginx/');
$configFile = version_compare($nginxVersion, '1.25.1', ">=") ? 'secure.valet.conf' : 'secure.valet-legacy.conf';
$siteConf = $this->replaceOldLoopbackWithNew(
$this->files->getStub('secure.valet.conf'),
$this->files->getStub($configFile),
'VALET_LOOPBACK',
$this->valetLoopback()
);
@@ -774,8 +777,11 @@ public function proxyCreate(string $url, string $host, bool $secure = false): vo
$proxyUrl .= '.'.$tld;
}
$nginxVersion = ltrim(exec('nginx -v'), 'nginx version: nginx/');
$configFile = version_compare($nginxVersion, '1.25.1', ">=") ? 'secure.proxy.valet.conf' : 'secure.proxy.valet-legacy.conf';
$siteConf = $this->replaceOldLoopbackWithNew(
$this->files->getStub($secure ? 'secure.proxy.valet.conf' : 'proxy.valet.conf'),
$this->files->getStub($secure ? $configFile : 'proxy.valet.conf'),
'VALET_LOOPBACK',
$this->valetLoopback()
);