From 92d7b0adcef136f1fb7fbd6b73ea3d4c3b00d6e6 Mon Sep 17 00:00:00 2001 From: Josh Sherman Date: Sat, 20 Oct 2012 16:12:07 -0400 Subject: [PATCH] Got nginx configured and tweaked the fluid variables --- bootstrap/conf/nginx.conf | 54 ++++++++++++++++++++++++ bootstrap/templates/__shared/index.phtml | 4 +- 2 files changed, 56 insertions(+), 2 deletions(-) diff --git a/bootstrap/conf/nginx.conf b/bootstrap/conf/nginx.conf index e69de29..8b2242e 100644 --- a/bootstrap/conf/nginx.conf +++ b/bootstrap/conf/nginx.conf @@ -0,0 +1,54 @@ +server +{ + listen 80; + + server_name pickles.local; + + access_log /var/log/nginx/pickles.access.log; + error_log /var/log/nginx/pickles.error.log; + root /usr/share/pickles/bootstrap/public; + + rewrite_log on; + + # Rewrites static content with an appended timestamp + location ~ ^/(.+)\.(\d+)\.(css|js|gif|png|jpg|jpeg)$ + { + rewrite ^/(.+)\.(\d+)\.(css|js|gif|png|jpg|jpeg)$ /$1.$3 break; + expires max; + } + + location / + { + index index.php; + + # Strips the trailing slash + rewrite ^/(.*)/$ /$1 permanent; + + # if file exists return it right away + if (-f $request_filename) + { + expires max; + break; + } + + if (!-e $request_filename) + { + rewrite ^/(.+)$ /index.php?request=$1 last; + } + } + + location ~ index\.php$ + { + try_files $uri =404; + include /etc/nginx/fastcgi_params; + + fastcgi_pass 127.0.0.1:9000; + fastcgi_index index.php; + fastcgi_param SCRIPT_FILENAME /usr/share/pickles/bootstrap/public$fastcgi_script_name; + } + + location ~ /\.ht + { + deny all; + } +} diff --git a/bootstrap/templates/__shared/index.phtml b/bootstrap/templates/__shared/index.phtml index 090f5d7..9813406 100644 --- a/bootstrap/templates/__shared/index.phtml +++ b/bootstrap/templates/__shared/index.phtml @@ -28,7 +28,7 @@