Skip to content

Instantly share code, notes, and snippets.

@soffes
Created March 25, 2009 14:56
Show Gist options
  • Save soffes/85513 to your computer and use it in GitHub Desktop.
Save soffes/85513 to your computer and use it in GitHub Desktop.
server {
listen 80;
server_name example.com;
location / {
root /var/www/example.com/html;
index index.php index.html;
if (!-e $request_filename) {
rewrite ^/(.*)$ /index.php?$1 last;
break;
}
}
error_page 404 /404.html;
location ~ \.php$ {
root /var/www/example.com/html;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /var/www/example.com/html$fastcgi_script_name;
include fastcgi_params;
}
}
server {
listen 80;
server_name *.example.com;
rewrite ^(.*) http://example.com$1 permanent;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment