Nginx, Unicorn, Rails4でurl_forを使ったら変なURLになってしまったので対処法を書いておく
Ninxで
server hoge.com;
proxy_pass http://upstream;
のような設定をしているとurl_forで
http://hoge.com
となってほしいところが
http://upstream
となってしまうので、ググって対処を調べた。
ruby - How to preserve request url with nginx proxy_pass - Stack Overflowを参考にして
proxy_set_header Host http://hoge.com
を追記したら上手く動いた。