mirror of
https://github.com/envoyr/nginx-configurator.git
synced 2026-04-28 04:06:18 +00:00
Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| cb2b55b936 | |||
| eeb85df689 |
@@ -46,7 +46,7 @@ class Location extends Context
|
||||
public function __toString() : string
|
||||
{
|
||||
return sprintf(
|
||||
"{$this->name} %s %s {\n\t%s\n}\n",
|
||||
"{$this->name} %s %s {\n\t%s\n}",
|
||||
$this->match,
|
||||
$this->location,
|
||||
implode("\n\t", (array)$this->childNodes->getIterator())
|
||||
|
||||
@@ -16,12 +16,13 @@ class Factory
|
||||
/**
|
||||
* Creates Server node
|
||||
* @param int $port
|
||||
* @param array $additionalParams
|
||||
* @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)]);
|
||||
$listenIPv6 = new Directive('listen', [new Param("[::]:{$port}")]);
|
||||
$listenIPv4 = new Directive('listen', [new Param($port), ...$additionalParams]);
|
||||
$listenIPv6 = new Directive('listen', [new Param("[::]:{$port}"), ...$additionalParams]);
|
||||
|
||||
return new Server([$listenIPv4, $listenIPv6]);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user