0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

【Rails】[ActionDispatch::HostAuthorization::DefaultResponseApp] Blocked hosts:への対応

Posted at

エラー

フロントのNext.jsからrailsにアクセスしようとした時に発生

  [ActionDispatch::HostAuthorization::DefaultResponseApp] Blocked hosts: rails:3000
  ⨯ upstream image response failed ... 403

対応

調べるとrailsのセキュリティ機能(Host Authorization)が、rails:3000
というホスト名からのリクエストをブロックしてるのが原因と判明。
rails/config/environments/development.rbに以下を追加することで解決した。

Rails.application.configure do
config.hosts << "許可するホスト"
end

参考

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?