Created
July 9, 2010 22:57
-
-
Save kidpollo/470218 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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