# /folder redirect to remote account
location ^~ /folder/ {
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwared-For $proxy_add_x_forwarded_for;
proxy_intercept_errors on;
proxy_pass http://remoteIP_or_hostname/;
}
Once saved restart nginx. Note, not all scripts will be happy about this configuration but we have found it to be the most friendly of the possible forwards.