Skip to content

Instantly share code, notes, and snippets.

@CarterA
Created September 19, 2010 06:38
Show Gist options
  • Select an option

  • Save CarterA/586483 to your computer and use it in GitHub Desktop.

Select an option

Save CarterA/586483 to your computer and use it in GitHub Desktop.
server {
server_name www.zcr.me;
rewrite ^ $scheme://zcr.me$request_uri permanent;
}
server {
set $user carterallen;
set $site zcr.me;
listen 80;
server_name $site www.$site;
root /home/$user/sites/$site/public;
#charset koi8-r;
access_log /home/$user/sites/$site/logs/access.log main;
location / {
index index.html index.htm index.php;
if (!-f $request_filename) {
set $rule_0 1$rule_0;
}
if (!-d $request_filename) {
set $rule_0 2$rule_0;
}
if ($rule_0 = "21"){
rewrite ^/([0-9a-zA-Z]+)/?$ /index.php?id=$1 last;
}
}
error_page 404 /errors/404.html;
# redirect server error pages to the static page /50x.html
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment