Skip to content

Commit

Permalink
New virtualhost stuff for adam.
Browse files Browse the repository at this point in the history
  • Loading branch information
pgib committed Jan 5, 2012
1 parent b0dd194 commit e1bd190
Show file tree
Hide file tree
Showing 2 changed files with 67 additions and 0 deletions.
4 changes: 4 additions & 0 deletions upstreams/adam.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
upstream adam
{
server localhost:3001 max_fails=3 fail_timeout=2s;
}
63 changes: 63 additions & 0 deletions virtualhosts/adam.localhost.coverallcrew.com.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
server
{
listen 127.0.0.1:8080;
server_name adam.localhost.coverallcrew.com;

root /usr/local/sites/ayv/adam/public;
index index.html;

location ~* /medias/.*?/upload
{
# Store files to this directory
# The directory is hashed, subdirectories 0 1 2 3 4 5 6 7 8 9 should exist
# i.e. make sure to create /u/apps/bugle/shared/uploads_tmp/0 /u/apps/bugle/shared/uploads_tmp/1 etc.
upload_store /Users/emh/Projects/rails3-mongoid-devise/tmp/uploads 1;

# set permissions on the uploaded files
upload_store_access user:rw group:rw all:r;

# Set specified fields in request body
# this puts the original filename, new path+filename and content type in the requests params
upload_set_form_field upload[fast_asset][original_name] "$upload_file_name";
upload_set_form_field upload[fast_asset][content_type] "$upload_content_type";
upload_set_form_field upload[fast_asset][filepath] "$upload_tmp_path";

upload_pass_form_field "^theme_id$|^blog_id$|^authenticity_token$|^format$";
upload_cleanup 400 404 499 500-505;
upload_resumable on;
}

location @fast_upload_endpoint
{
#passenger_enabled on; # or this could be your mongrel/thin backend
proxy_pass http://adam;
}

location ^~ /
{
proxy_pass_request_headers on;
proxy_ignore_headers Expires Cache-Control;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass_header Set-Cookie;
proxy_set_header Host $http_host;
proxy_pass http://adam;

gzip on;
gzip_min_length 1000;
gzip_proxied expired no-cache no-store private auth;
gzip_types text/plain text/css application/xml application/json application/javascript;
gzip_disable "MSIE [1-6]\.";

if (-f $request_filename)
{
break;
}
}

gzip on;
gzip_min_length 1000;
gzip_proxied expired no-cache no-store private auth;
gzip_types text/plain text/css application/xml application/json application/javascript;
gzip_disable "MSIE [1-6]\.";

}

0 comments on commit e1bd190

Please sign in to comment.