2
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

NGINX + unicorn + Rails 設定時のハマりどころ

Posted at

Rails Tutorial の成果物を EC2 で動かすための環境構築でハマった箇所のメモです。

  1. unicorn と nginx の起動ユーザが一致している必要があるらしい。
    aws nginx + unicorn (13:permission dnined) while connecting to upstream でハマッた時に試したことのTIPS

  2. unicorn.sock ファイルの配置場所は、 /tmp/ではなく、railsディレクトリ配下の tmp/に配置する必要があるらしい。

  3. httpでアクセスすると、https にリダイレクトしてしまう場合、以下の設定を追加する。

    config/environments/production.rb
    # 既定値は、 config.force_ssl = true
    config.fore_ssl = false
    
  4. cssが反映されない場合、以下の設定を追加する。

    config/environments/production.rb
    config.serve_static_files = true
    
2
1
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
2
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?