Skip to content

Instantly share code, notes, and snippets.

@paramah
Created November 4, 2012 16:04
Show Gist options
  • Save paramah/4012425 to your computer and use it in GitHub Desktop.
Save paramah/4012425 to your computer and use it in GitHub Desktop.
nginx dev template
server {
listen 80;
server_name @@domain@@;
access_log @@dir@@/access.log slim;
error_log @@dir@@/error.log;
location / {
root @@dir@@;
if (-f $request_filename) {
expires 30d;
break;
}
if (!-e $request_filename) {
rewrite ^(.+)$ /index.php?q=$1 last; #=
}
index index.html index.php;
}
location ~ \.php$ {
include /usr/local/etc/nginx/fastcgi_params;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME @@dir@@$fastcgi_script_name;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment