-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
67 additions
and
0 deletions.
There are no files selected for viewing
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
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; | ||
} |
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
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]\."; | ||
|
||
} |