upstream app_name_for_replace {

# Path to Unicorn SOCK file, as defined previously
server unix:deploy_directory_for_replace/current/tmp/unicorn.sock;

}

server {

listen 80;
server_name domain_for_replace;

# Application root, as defined previously
root deploy_directory_for_replace/current/public;

try_files $uri @app_name_for_replace;
access_log /var/log/nginx/app_name_for_replace_access.log;
error_log /var/log/nginx/app_name_for_replace_error.log;

location @app_name_for_replace{
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header Host $http_host;
    proxy_redirect off;
    proxy_pass http://app_name_for_replace;
}

error_page 500 502 503 504 /500.html;
client_max_body_size 4G;
keepalive_timeout 10;

}