Permalink
Browse files

New virtualhost stuff for adam.

  • Loading branch information...
1 parent b0dd194 commit e1bd190ab5426bc7cf941bc0302e2aa9308bd890 @pgib pgib committed Jan 5, 2012
Showing with 67 additions and 0 deletions.
  1. +4 −0 upstreams/adam.conf
  2. +63 −0 virtualhosts/adam.localhost.coverallcrew.com.conf
View
@@ -0,0 +1,4 @@
+upstream adam
+{
+ server localhost:3001 max_fails=3 fail_timeout=2s;
+}
@@ -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.