<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>302 on Evan Hoffman</title><link>https://evan.wtf/tags/302/</link><description>Recent content in 302 on Evan Hoffman</description><generator>Hugo</generator><language>en-US</language><copyright>Evan Hoffman</copyright><lastBuildDate>Fri, 28 Mar 2014 15:17:30 +0000</lastBuildDate><atom:link href="https://evan.wtf/tags/302/index.xml" rel="self" type="application/rss+xml"/><item><title>Rails app redirects to wrong port?</title><link>https://evan.wtf/2014/03/28/rails-app-redirects-to-wrong-port/</link><pubDate>Fri, 28 Mar 2014 15:17:30 +0000</pubDate><guid>https://evan.wtf/2014/03/28/rails-app-redirects-to-wrong-port/</guid><description>&lt;p&gt;Ran into a situation in which a rails application was redirecting to /login to force a user to log in, but the Location header said &amp;ldquo;&lt;a href="http://site.com:8085/login%22"&gt;http://site.com:8085/login"&lt;/a&gt;, because nginx was listening on port 8085 on that server. At first I looked to see if there was something in the application code that was doing this, or maybe some setting I could change to fix it, but came up blank. After some Googling I found the answer right &lt;a href="http://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_redirect"&gt;in the Nginx docs&lt;/a&gt; (below is my slightly-modified solution that handles https urls as well):&lt;/p&gt;</description></item></channel></rss>