Created
August 22, 2009 16:45
-
-
Save markiz/172839 to your computer and use it in GitHub Desktop.
This file contains 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 merb { | |
server 127.0.0.1:4000; | |
} | |
server { | |
listen 80; | |
server_name orwik.local *.orwik.local; | |
# serve stylesheets/vendor, that is known to be pure CSS, directly | |
location ~ ^/stylesheets/vendor/ | |
{ | |
# do not add log entries | |
access_log off; | |
expires 30d; | |
break; | |
} | |
location ~* ^/stylesheets/.*\.css$ | |
{ | |
rewrite ^/stylesheets/(.*)$ /stylesheets/compiled/$1 break; | |
break; | |
} | |
location ~* ^/javascripts/.*\.css$ | |
{ | |
rewrite ^/javascripts/(.*)$ /javascripts/compiled/$1 break; | |
break; | |
} | |
# if file exists, serve it and do not proceed any further | |
if (-f $request_filename) | |
{ | |
break; | |
} | |
root /Users/inviz/Sites/orwik/frontend/public; | |
index index.html index.htm; | |
location / { | |
proxy_set_header X-Real-IP $remote_addr; | |
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | |
proxy_set_header Host $http_host; | |
proxy_redirect false; | |
if (-f $request_filename) { | |
rewrite (.*) $1 break; | |
} | |
if (!-f $request_filename) { | |
proxy_pass http://merb; | |
break; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment