EC2上にRailsアプリをUnicorn + Nginxでデプロイしようとしています。
UnicornとNginxをスタートしてec2のURLにアクセスしたところ、Nginxのデフォルトページが表示されるだけでアプリが表示されません。エラーは何も出ていないので、Nginxがアプリ側と連携できていないのではないかと思っています。
全ての設定は以下の記事を(細かい部分は調べつつ)写経したので、何がおかしいのかと困っています。
Nginxのデフォルトページには
"You should now put your content in a location of your choice and edit the root configuration directive in the nginx configuration file /etc/nginx/nginx.conf."
と書いてあるので、ルートの設定がおかしいのではないかと思うのですが、そもそもRailsアプリに対してはルートファイルを何と設定すれば良いかも分かりません。(application.html.erb?)
nginx.confの内容は以下です。
user nginx; worker_processes auto; error_log /var/log/nginx/error.log; pid /var/run/nginx.pid; events { worker_connections 1024; } http { log_format main '$remote_addr - $remote_user [$time_local] "$request" ' '$status $body_bytes_sent "$http_referer" ' '"$http_user_agent" "$http_x_forwarded_for"'; access_log /var/log/nginx/access.log main; sendfile on; tcp_nopush on; tcp_nodelay on; keepalive_timeout 65; types_hash_max_size 2048; include /etc/nginx/mime.types; default_type application/octet-stream; # Load modular configuration files from the /etc/nginx/conf.d directory. # See http://nginx.org/en/docs/ngx_core_module.html#include # for more information. include /etc/nginx/conf.d/*.conf; server { listen 80 default_server; listen [::]:80 default_server; server_name _; root /usr/share/nginx/html; # Load configuration files for the default server block. include /etc/nginx/default.d/*.conf; location / { } error_page 404 /404.html; location = /40x.html { } error_page 500 502 503 504 /50x.html; location = /50x.html { } } }
もし何か原因や修正点など心当たりがあれば教えていただきたいです。
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2017/06/05 06:51
2017/06/05 07:34
2017/06/05 08:07