diff --git a/lib/sg_fargate_rails/railtie.rb b/lib/sg_fargate_rails/railtie.rb index 4110b5a..19af7e1 100644 --- a/lib/sg_fargate_rails/railtie.rb +++ b/lib/sg_fargate_rails/railtie.rb @@ -10,7 +10,7 @@ class Railtie < ::Rails::Railtie load File.expand_path('../tasks/sg_fargate_rails.rake', __dir__) end - initializer :initialize_sg_fargate_rails do |app| + initializer :initialize_sg_fargate_rails, after: :load_config_initializers do |app| if SgFargateRails.config.middleware_enabled_rails_envs.include?(Rails.env) app.config.middleware.insert 0, SgFargateRails::AdjustCloudfrontHeaders app.config.middleware.insert 1, SgFargateRails::Healthcheck