diff --git a/.env.example b/.env.example index e6075e55e..c4f3a4d98 100644 --- a/.env.example +++ b/.env.example @@ -1,4 +1,6 @@ SECRET_KEY_BASE= +# Force all access to the app over SSL, default is set to false +FORCE_SSL= #redis config REDIS_URL=redis://redis:6379 diff --git a/config/environments/production.rb b/config/environments/production.rb index a2031ce37..cf3cdca21 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -39,7 +39,7 @@ Rails.application.configure do config.active_storage.service = ENV.fetch('ACTIVE_STORAGE_SERVICE', 'local').to_sym # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies. - # config.force_ssl = true + config.force_ssl = ENV.fetch('FORCE_SSL', false) # Use the lowest log level to ensure availability of diagnostic information # when problems arise. diff --git a/config/environments/staging.rb b/config/environments/staging.rb index db4b952cb..e61986459 100644 --- a/config/environments/staging.rb +++ b/config/environments/staging.rb @@ -40,7 +40,7 @@ Rails.application.configure do # config.action_cable.allowed_request_origins = [ 'http://example.com', /http:\/\/example.*/ ] # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies. - config.force_ssl = false + config.force_ssl = ENV.fetch('FORCE_SSL', false) # Use the lowest log level to ensure availability of diagnostic information # when problems arise.