Skip to content

Instantly share code, notes, and snippets.

@markiz
Created August 22, 2009 16:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save markiz/172839 to your computer and use it in GitHub Desktop.
Save markiz/172839 to your computer and use it in GitHub Desktop.
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