Update Factory.php

This commit is contained in:
2022-10-27 20:54:55 +02:00
committed by GitHub
parent 75d3302a3a
commit 0a3592107e

View File

@@ -1,10 +1,4 @@
<?php <?php
/**
* Created by PhpStorm.
* User: mbrzuchalski
* Date: 14.06.16
* Time: 11:22
*/
namespace Envoyr\NginxConfigurator; namespace Envoyr\NginxConfigurator;
use Envoyr\NginxConfigurator\Config\Location; use Envoyr\NginxConfigurator\Config\Location;
@@ -27,7 +21,7 @@ class Factory
public function createServer(int $port = 80) : Server public function createServer(int $port = 80) : Server
{ {
$listenIPv4 = new Directive('listen', [new Param($port)]); $listenIPv4 = new Directive('listen', [new Param($port)]);
$listenIPv6 = new Directive('listen', [new Param("[::]:{$port}"), new Param('default'), new Param('ipv6only=on')]); $listenIPv6 = new Directive('listen', [new Param("[::]:{$port}")]);
return new Server([$listenIPv4, $listenIPv6]); return new Server([$listenIPv4, $listenIPv6]);
} }