Setup/Webserver: Add nginx configuration

refs #6738
This commit is contained in:
Marius Hein 2014-11-06 11:06:55 +01:00
parent 8e28fff524
commit f49c8c02db
1 changed files with 35 additions and 0 deletions

View File

@ -0,0 +1,35 @@
<?php
// {{{ICINGA_LICENSE_HEADER}}}
// {{{ICINGA_LICENSE_HEADER}}}
namespace Icinga\Config\Webserver;
/**
* Create nginx webserver configuration
*/
class Nginx extends Webserver
{
/**
* Specific template
*
* @return array|string
*/
protected function getTemplate()
{
return array(
'location ~ ^{webPath}/index\.php(.*)$ {',
' # fastcgi_pass 127.0.0.1:9000;',
' fastcgi_pass unix:/var/run/php5-fpm.sock;',
' fastcgi_index index.php;',
' include fastcgi_params;',
' fastcgi_param SCRIPT_FILENAME {publicPath}/index.php;',
'}',
'location ~ ^{webPath} {',
' alias {publicPath};',
' index index.php;',
' try_files $uri $uri/ {webPath}/index.php$is_args$args;',
'}',
);
}
}