fv17の日記

Webエンジニアの備忘用ブログです。主にWeb界隈の技術に関して書いています。

Herokuの本番環境でSSL

RailsをHerokuにデプロイした際に、SSLを強制させる設定

config/environments/production.rb

Rails.application.configure do
  .
  .
  .
  # Force all access to the app over SSL, use Strict-Transport-Security,
  # and use secure cookies.
  config.force_ssl = true
  .
  .
  .
end
||

** 独自ドメインの場合は別途設定が必要