Skip to content

Instantly share code, notes, and snippets.

@kidpollo
Created July 9, 2010 22:57
Show Gist options
  • Save kidpollo/470218 to your computer and use it in GitHub Desktop.
Save kidpollo/470218 to your computer and use it in GitHub Desktop.
upstream example {
server unix:/data/example/shared/tmp/pids/example.sock;
}
server {
listen 80;
server_name *.example.com;
root /data/example/current/public;
access_log /data/nginx/log/example.access.log main;
error_log /data/nginx/log/example.error.log notice;
include /etc/nginx/common/app.conf;
if ($host ~* ^([^.]+\.[^.]+)$) {
set $host_without_subdomain $1;
rewrite ^\/(\w+)(\/.*)$ http://$1.$host_without_subdomain$2 break;
}
location / {
include /etc/nginx/common/proxy.conf;
if (!-f $request_filename) {
proxy_pass http://empowerkit;
break;
}
}
location = /500.html {
root /data/example/current/public;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment