Listeners

Get all listeners

$unit->getConfig()->getListeners()

Get listener by port

$unit->getConfig()->getListenerByPort(80)

Adding listener

Object creating

// Create Nginx Unit listener
$listener = new Listener('*:8800', 'routes/laravel');

// Add listener to Config and upload it
$unit->getConfig()->addListener($listener);

From file

$unit->getConfig()->uploadListenerFromFile('/home/ubuntu/example.pem', '*:80')

Last updated