Skip to content

Instantly share code, notes, and snippets.

@jakemarsh
Created May 28, 2013 18:07
Show Gist options
  • Save jakemarsh/5664769 to your computer and use it in GitHub Desktop.
Save jakemarsh/5664769 to your computer and use it in GitHub Desktop.
user www;
worker_processes 4;
error_log logs/error.log;
pid temp/nginx.pid;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;
gzip on;
server {
listen 80;
server_name localhost;
root /Users/username/Develop/Sites/localhost;
index index.php;
sendfile on;
keepalive_timeout 15;
charset utf-8;
location / {
if (-f $request_filename) {
break;
}
rewrite ^ /index.php last;
}
location ~ \.php$ {
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
include fastcgi_params;
}
location ~ /\.ht {
deny all;
}
}
server {
listen 80 default;
server_name _;
root /Users/username/Develop/Sites/$host/web;
index index.php;
sendfile on;
keepalive_timeout 15;
charset utf-8;
location / {
if (-f $request_filename) {
break;
}
if (!-d /Users/username/Develop/Sites/$host/web) {
rewrite ^ localhost;
}
rewrite ^ /index.php last;
}
location ~ \.php$ {
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
include fastcgi_params;
}
location ~ /\.ht {
deny all;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment