I'm using the ActiveAdmin gem in a Rails 4 app, and having trouble when it's deployed in production. It's working fine in development, or when I run it locally in production.
For example, after saving an Asset, instead of redirecting to https://domainname.com/admin/assets/1
, it redirects to https://localhost/admin/assets/1
, which doesn't exist, so it blows up.
As far as I can tell, I have things set up correctly. Here's my routes file:
Rails.application.routes.draw do
root to: redirect_to('/admin')
devise_for :admin_users, ActiveAdmin::Devise.config
ActiveAdmin.routes(self)
end
Things seem to work fine in production mode when I'm running it locally, but not when after it's been deployed behind SSL.
Has anyone else had trouble like this when using SSL with ActiveAdmin?
It turns out the nginx configuration was bad. Nothing to do with the Rails code at all!