mirror of
https://github.com/envoyr/nginx-configurator.git
synced 2026-04-30 21:24:02 +00:00
Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| eeb85df689 |
@@ -16,12 +16,13 @@ class Factory
|
|||||||
/**
|
/**
|
||||||
* Creates Server node
|
* Creates Server node
|
||||||
* @param int $port
|
* @param int $port
|
||||||
|
* @param array $additionalParams
|
||||||
* @return Server
|
* @return Server
|
||||||
*/
|
*/
|
||||||
public function createServer(int $port = 80) : Server
|
public function createServer(int $port = 80, array $additionalParams = []) : Server
|
||||||
{
|
{
|
||||||
$listenIPv4 = new Directive('listen', [new Param($port)]);
|
$listenIPv4 = new Directive('listen', [new Param($port), ...$additionalParams]);
|
||||||
$listenIPv6 = new Directive('listen', [new Param("[::]:{$port}")]);
|
$listenIPv6 = new Directive('listen', [new Param("[::]:{$port}"), ...$additionalParams]);
|
||||||
|
|
||||||
return new Server([$listenIPv4, $listenIPv6]);
|
return new Server([$listenIPv4, $listenIPv6]);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user