Question

I'm deploying my existing https rails app to a staging server, and for some reason I keep getting redirected to the https version of the site (which is the desired behavior on the production server, but not on the staging on to which I'm deploying). On the staging server it doesn't return anything after getting redirected to https.

When I type in my.ip.add.ress in the browser, it redirects to https://my.ip.add.ress. I've checked that config.force_ssl = false. There does not appear to be any other function in my app that would redirect to ssl (searched for all occurrences of ssl and https in my app). rails c production boots up fine.

I'm not even sure my app is getting hit, as my production.log isn't being written to. Could apache be trying to redirect to ssl? There are no such directives in the apache2.conf (https://wiki.apache.org/httpd/RewriteHTTPToHTTPS).

I'm running Apache2 with the Passenger module. I don't have a .htaccess file in my app. It's a Rails 3.2 app.

Was it helpful?

Solution

Did you have "force_ssl = true" at one point? That would create a permanent redirect. Clearing your cache will fix that.

Or perhaps you've set the "Strict-Transport-Security" header on that domain? That would also force a redirect to the HTTPS version. To turn that off in chrome, navigate to "chrome://net-internals/#hsts". Then delete that domain. You can query it first, to see if exists in the cache.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top