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 @@