2
0

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 3 years have passed since last update.

404 Not Found nginx/1.12.2とは何か・解決方法

Posted at

EC2でnginxを起動した際にエラーが発生した
##404 Not Foundとは何か
存在しないwebページへのアクセス時に発生するHTTPステータスコードのこと。
発生する要因として、該当アドレスのページがない、またはそのサーバーが落ちている状態などがある。
##解決方法
まず、nginxのエラーログを確認

$ sudo tail -n 20 /var/log/nginx/error.log

 [error] 30547#0: *11 FastCGI sent in stderr: "Primary script unknown" while reading response header from upstream, client: ****, server: _, request: "GET / HTTP/1.1", upstream: "fastcgi://unix:/run/php-fpm/www.sock:", host: "****"

どうやらnginx.confのrootが間違っていたらしい

server {
        listen       80 default_server;
        listen       [::]:80 default_server;
        server_name  _;
        root         /home/webapp/laravel-ci/public; #この行を変更
        (/usr/share/nginx/html;を/home/webapp/laravel-ci/public;に)

        location / {
        }
2
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
2
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?