Permalink
Find file
Fetching contributors…
Cannot retrieve contributors at this time
76 lines (60 sloc) 2.17 KB
server
{
listen 127.0.0.1:8080;
server_name adam.localhost.coverallcrew.com;
root /usr/local/sites/ayv/adam/public;
index index.html;
log_subrequest on;
log_not_found on;
#location ^~ /upload/medias/
location ~* /medias/.*?/upload
#location ~ upload$
{
log_subrequest on;
log_not_found on;
# pass request body to here
upload_pass @fast_upload_endpoint;
# 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 /usr/local/sites/ayv/adam/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]\.";
}