From c02d3f0464b0e7faa50ddd2ed2a20fe88cd60845 Mon Sep 17 00:00:00 2001
From: Falko Timme <ft@falkotimme.com>
Date: Tue, 19 Nov 2013 17:25:45 -0500
Subject: [PATCH] - nginx: added {DOCROOT} and {FASTCGIPASS} placeholders to directive snippets and nginx Directives fields.

---
 server/plugins-available/nginx_plugin.inc.php |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/server/plugins-available/nginx_plugin.inc.php b/server/plugins-available/nginx_plugin.inc.php
index 2e93944..b49f2d2 100644
--- a/server/plugins-available/nginx_plugin.inc.php
+++ b/server/plugins-available/nginx_plugin.inc.php
@@ -1041,8 +1041,9 @@
 		$nginx_directives = str_replace("\r", "\n", $nginx_directives);
 		$nginx_directive_lines = explode("\n", $nginx_directives);
 		if(is_array($nginx_directive_lines) && !empty($nginx_directive_lines)){
+			$trans = array('{DOCROOT}' => $vhost_data['web_document_root_www'], '{FASTCGIPASS}' => 'fastcgi_pass '.($data['new']['php_fpm_use_socket'] == 'y'? 'unix:'.$fpm_socket : '127.0.0.1:'.$vhost_data['fpm_port']).';');
 			foreach($nginx_directive_lines as $nginx_directive_line){
-				$final_nginx_directives[] = array('nginx_directive' => $nginx_directive_line);
+				$final_nginx_directives[] = array('nginx_directive' => strtr($nginx_directive_line, $trans));
 			}
 		}
 		$tpl->setLoop('nginx_directives', $final_nginx_directives);

--
Gitblit v1.9.1