Skip to content

Instantly share code, notes, and snippets.

@frank-who
Created November 20, 2011 16:32
Show Gist options
  • Save frank-who/1380446 to your computer and use it in GitHub Desktop.
Save frank-who/1380446 to your computer and use it in GitHub Desktop.
Bare-bone nginx.conf with mass hosts
#user nobody;
worker_processes 1;
#error_log logs/error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info;
#pid logs/nginx.pid;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
charset utf-8;
sendfile on;
keepalive_timeout 65;
#log_format main '$host | $app_dir';
#access_log logs/host.access.log main;
# Default
server {
listen 8080;
server_name localhost;
location / {
root html;
index index.html index.htm;
}
}
server {
listen 8080;
server_name ~^(.*\.)?(.*)\.(dev|com|net|co\.za)$;
set $app_dir $2;
root /Users/frank/Projects/rails/$app_dir/public;
try_files $uri/index.html $uri @unicorn;
location @unicorn {
proxy_pass http://unix:/tmp/unicorn.$app_dir.sock;
}
error_page 500 502 503 504 /500.html;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment