Skip to content

Instantly share code, notes, and snippets.

@Aeon
Created August 23, 2010 07:33
Show Gist options
  • Save Aeon/545003 to your computer and use it in GitHub Desktop.
Save Aeon/545003 to your computer and use it in GitHub Desktop.
server {
listen *:80;
server_name nt.nyxcouture.com;
server_name nikatang.com;
location / {
root /var/www/vhosts/nikatang/current;
index index.php index.html index.htm;
}
location /blog {
root /var/www/vhosts/nikatang/current;
index index.php;
# if file exists return it right away
if (-f $request_filename) {
expires 30d;
break;
}
# otherwise rewrite it
if (!-e $request_filename) {
rewrite ^(.+)$ index.php$1 last;
break;
}
}
# if the request starts with our frontcontroller, pass it on to fastcgi
location ~ \.php/?$
{
root /var/www/vhosts/nikatang/current;
if (!-f $request_filename) { return 404; }
fastcgi_pass unix:/var/run/php-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
# fastcgi_param PATH_INFO $fastcgi_script_name;
include /usr/local/nginx/conf/fastcgi_params;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment