From f927494ece5a230889b9a47abab8a58c2cec0328 Mon Sep 17 00:00:00 2001
From: ftimme <ft@falkotimme.com>
Date: Mon, 19 Sep 2011 13:48:34 -0400
Subject: [PATCH] Added support for the "Redirect" tab to nginx.

---
 server/conf/nginx_vhost.conf.master |   11 ++++++++++-
 1 files changed, 10 insertions(+), 1 deletions(-)

diff --git a/server/conf/nginx_vhost.conf.master b/server/conf/nginx_vhost.conf.master
index 9da8c2b..ccad2d7 100644
--- a/server/conf/nginx_vhost.conf.master
+++ b/server/conf/nginx_vhost.conf.master
@@ -10,6 +10,13 @@
         server_name <tmpl_var name='domain'> <tmpl_var name='alias'>;
 
         root   <tmpl_var name='web_document_root_www'>;
+		
+        <tmpl_loop name="redirects">
+		
+        if ($http_host ~* "<tmpl_var name='rewrite_domain'>$") {
+            rewrite ^/(.+)$ <tmpl_var name='rewrite_target'>$1 <tmpl_var name='rewrite_type'>;
+        }
+        </tmpl_loop>
 
         location / {
             index index.html index.php;
@@ -47,7 +54,7 @@
             log_not_found off;
         }
 		
-        location = /favicon.ico {
+        location /favicon.ico {
             log_not_found off;
             access_log off;
         }
@@ -67,6 +74,7 @@
         <tmpl_if name='php' op='==' value='fast-cgi'>
 		
         location ~ \.php$ {
+            try_files $uri =404;
             fastcgi_pass 127.0.0.1:<tmpl_var name='fpm_port'>;
             fastcgi_index index.php;
             fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
@@ -83,6 +91,7 @@
 		<tmpl_if name='cgi' op='==' value='y'>
 		
         location /cgi-bin/ {
+            try_files $uri =404;
             root <tmpl_var name='document_root'>;
             gzip off;
             fastcgi_pass  unix:/var/run/fcgiwrap.socket;

--
Gitblit v1.9.1