Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Setup/Webserver: Add nginx configuration
refs #6738
- Loading branch information
Showing
1 changed file
with
35 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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;', | ||
'}', | ||
); | ||
} | ||
} |