前提・実現したいこと
Ubuntu18.04です。Nginxを入れて、Unicornを入れていわゆるWeb三層なるものにしたいと思っていますが、肝心のNginxが起動しません。Unicornを入れる時にNginx.confをいじったので、これが原因なのかもしれませんが、超絶初心者なので下記を読んでも分かりません。何が理由で起動しないと考えられるでしょうか。
発生している問題・エラーメッセージ
vpsuser@ipaddress:~$ nginx -v nginx version: nginx/1.14.0 (Ubuntu) vpsuser@ipaddress:~$ journalctl -u nginx Hint: You are currently not seeing messages from other users and the system. Users in groups 'adm', 'systemd-journal' can see all messages. Pass -q to turn off this notice. -- Logs begin at Sun 2019-07-07 14:14:00 JST, end at Mon 2019-07-22 23:20:30 JST. -- -- No entries -- vpsuser@ipaddress:~$ systemctl status nginx.service ● nginx.service - A high performance web server and a reverse proxy server Loaded: loaded (/lib/systemd/system/nginx.service; enabled; vendor preset: enabled) Active: failed (Result: exit-code) since Mon 2019-07-22 23:22:18 JST; 1min 54s ago Docs: man:nginx(8) Process: 1516 ExecStartPre=/usr/sbin/nginx -t -q -g daemon on; master_process on; (code=exited, status=1/FAILURE) vpsuser@ipaddress:~$ sudo service nginx start Job for nginx.service failed because the control process exited with error code. See "systemctl status nginx.service" and "journalctl -xe" for details.
該当のソースコード
nginx.conf
user www-data; worker_processes auto; pid /run/nginx.pid; include /etc/nginx/modules-enabled/*.conf; events { worker_connections 768; # multi_accept on; } http { ## # Basic Settings ## sendfile on; tcp_nopush on; tcp_nodelay on; keepalive_timeout 65; types_hash_max_size 2048; # server_tokens off; # server_names_hash_bucket_size 64; # server_name_in_redirect off; include /etc/nginx/mime.types; default_type application/octet-stream; ## # SSL Settings ## ssl_protocols TLSv1 TLSv1.1 TLSv1.2; # Dropping SSLv3, ref: POODLE ssl_prefer_server_ciphers on; ## # Logging Settings ## access_log /var/log/nginx/access.log; error_log /var/log/nginx/error.log; ## # Gzip Settings ## gzip on; gzip_vary on; # gzip_proxied any; # gzip_comp_level 6; # gzip_buffers 16 8k; # gzip_http_version 1.1; gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/\ javascript; ## # Virtual Host Configs ## include /etc/nginx/conf.d/*.conf; include /etc/nginx/sites-enabled/*; upstream unicorn_server { server unix:/var/www/html/tmp/sockets/unicorn.sock; fail_timeout=0; } server { # Sinatraのpublicディレクトリの絶対パスを指定します root /var/www/html/public; # リクエストが通るポート番号を指定します listen 80; # クライアントからのリクエストの最大値を設定します client_max_body_size 4G; # サーバーはこの時間を過ぎたら接続を閉じます keepalive_timeout 5; location / { try_files $uri @app; } location @app { proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header Host $http_host; proxy_redirect off; # pass to the upstream unicorn server mentioned above proxy_pass http://unicorn_server; } }
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2019/07/22 16:36