AWS上でアプリケーションを公開しrake assets:precompileした後に
CSSが反映されておりません。mime typeのエラーですがnginxの設定も変更しましたが、表示されません。お手数ですが、どなたか対応方法をご教授いただければと存じます。
構築環境
rails4
nginx
unicorn
※unicorn nginx再起動済み
ファイヤフォックスでのエラー内容
MIME タイプが "text/css" ではなく "text/plain" となっているため、スタイルシート http://※※.jp/assets/application-0281edd3a7994877a47a814957f98705d398f68c7f0e62e796fcaffd5934eece.css は読み込まれていません。
※クロームでもmime typeでエラーが表示される
/var/www/blog/public/assets配下のファイル
application-0281edd3a7994877a47a894957f66705d398f68c7f0e62e796fcaffd5934eece.css application-0281edd3a7994877a47a894957f66705d398f68c7f0e62eåç796fcaffd5934eece.css.gz application-8101ae5a61a459f14a4b3702047783719f616d6fb4adf61110d388aed7cc2cf4.js application-8101ae5a61a459f14a4b3702047783719f616d6fb4adf61110d388aed7cc2cf4.js.gz
nginx 設定
events { worker_connections 2048; } http { error_log /var/www/blog/log/nginx.error.log; #自分のアプリケーション名 access_log /var/www/blog/log/nginx.access.log; #自分のアプリケーション名 # max body size client_max_body_size 2G; upstream app_server { # for UNIX domain socket setups server unix:/var/www/blog/tmp/sockets/.unicorn.sock fail_timeout=0; #自分のアプリケーション名 } server { listen 80; server_name サイトIP; # nginx so increasing this is generally safe... keepalive_timeout 5; # path for static files root /var/www/blog/public; #自分のアプリケーション名 # page cache loading try_files $uri/index.html $uri.html $uri @app; include /etc/nginx/mime.types; location @app { # HTTP headers proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header Host $http_host; proxy_redirect off; proxy_pass http://app_server; } # Rails error pages error_page 500 502 503 504 /500.html; location = /500.html { root /var/www/blog/public; #自分のアプリケーション名 } } }

回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。