Skip to content

Commit

Permalink
Setup/Webserver: Add nginx configuration
Browse files Browse the repository at this point in the history
refs #6738
  • Loading branch information
mxhash committed Nov 6, 2014
1 parent 8e28fff commit f49c8c0
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions library/Icinga/Config/Webserver/Nginx.php
@@ -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;',
'}',
);
}
}

0 comments on commit f49c8c0

Please sign in to comment.