LoginSignup
0
0

More than 5 years have passed since last update.

nginx+unicorn_railsでurl生成系ヘルパーがhttp://unicorn/...を返す問題

Last updated at Posted at 2016-11-30

タイトル通り。
image_url等が http://unicorn/assets/... というURLを返してしまう。

原因
  • request.hostに"unicorn"が入ってしまう為
対処
  • nginxにproxy_set_headerを追加
app.conf
    location / {
+       proxy_set_header Host $http_host;
        proxy_pass http://unicorn;
    }
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