Skip to content

Instantly share code, notes, and snippets.

@netaustin
Created January 11, 2013 16:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save netaustin/4512051 to your computer and use it in GitHub Desktop.
Save netaustin/4512051 to your computer and use it in GitHub Desktop.
This is an nginx config file for local development which automatically directs *.dev to ~/www/*
worker_processes 2;
error_log logs/error.log;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;
server {
listen 80;
server_name ~^(?<sub>.+)\.dev$;
root /Users/austin/www/$sub;
location / {
index index.php index.html index.htm;
try_files $uri $uri/ /index.php?$args&q=$uri;
}
location ~ \.php$ {
fastcgi_pass unix:/tmp/php-fpm.sock;
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