質問をすることでしか得られない、回答やアドバイスがある。

15分調べてもわからないことは、質問しよう!

新規登録して質問してみよう
ただいま回答率
85.48%
nginx

nginixは軽量で高性能なwebサーバーの1つです。BSD-likeライセンスのもとリリースされており、あわせてHTTPサーバ、リバースプロキシ、メールプロキシの機能も備えています。MacOSX、Windows、Linux、上で動作します。

WordPress

WordPressは、PHPで開発されているオープンソースのブログソフトウェアです。データベース管理システムにはMySQLを用いています。フリーのブログソフトウェアの中では最も人気が高く、PHPとHTMLを使って簡単にテンプレートをカスタマイズすることができます。

PHP

PHPは、Webサイト構築に特化して開発されたプログラミング言語です。大きな特徴のひとつは、HTMLに直接プログラムを埋め込むことができるという点です。PHPを用いることで、HTMLを動的コンテンツとして出力できます。HTMLがそのままブラウザに表示されるのに対し、PHPプログラムはサーバ側で実行された結果がブラウザに表示されるため、PHPスクリプトは「サーバサイドスクリプト」と呼ばれています。

AWS(Amazon Web Services)

Amazon Web Services (AWS)は、仮想空間を機軸とした、クラスター状のコンピュータ・ネットワーク・データベース・ストーレッジ・サポートツールをAWSというインフラから提供する商用サービスです。

Q&A

1回答

13493閲覧

nginxのエラーページに飛ばされる原因について

study_111

総合スコア82

nginx

nginixは軽量で高性能なwebサーバーの1つです。BSD-likeライセンスのもとリリースされており、あわせてHTTPサーバ、リバースプロキシ、メールプロキシの機能も備えています。MacOSX、Windows、Linux、上で動作します。

WordPress

WordPressは、PHPで開発されているオープンソースのブログソフトウェアです。データベース管理システムにはMySQLを用いています。フリーのブログソフトウェアの中では最も人気が高く、PHPとHTMLを使って簡単にテンプレートをカスタマイズすることができます。

PHP

PHPは、Webサイト構築に特化して開発されたプログラミング言語です。大きな特徴のひとつは、HTMLに直接プログラムを埋め込むことができるという点です。PHPを用いることで、HTMLを動的コンテンツとして出力できます。HTMLがそのままブラウザに表示されるのに対し、PHPプログラムはサーバ側で実行された結果がブラウザに表示されるため、PHPスクリプトは「サーバサイドスクリプト」と呼ばれています。

AWS(Amazon Web Services)

Amazon Web Services (AWS)は、仮想空間を機軸とした、クラスター状のコンピュータ・ネットワーク・データベース・ストーレッジ・サポートツールをAWSというインフラから提供する商用サービスです。

0グッド

0クリップ

投稿2020/06/07 00:00

編集2020/06/07 08:55

こちらの記事を参考に、wordpressの導入を進めていたのですが、ドメインを入力しwordpressの管理画面へアクセスする部分で、エラーページが表示されてしまいました。
表示されたエラーページは以下になります。
イメージ説明

こちらを参考に、「server_name」にドメインを追加しnginxを再起動、php-fpmを再起動し再度アクセスしてみましたが同様のエラーページが表示されてしまっている状況です。
修正が必要な部分など、ご助言頂けましたら幸いです。

追記
nginx.confは以下になります。

# For more information on configuration, see: # * Official English Documentation: http://nginx.org/en/docs/ # * Official Russian Documentation: http://nginx.org/ru/docs/ user nginx; worker_processes auto; error_log /var/log/nginx/error.log; pid /run/nginx.pid; # Load dynamic modules. See /usr/share/doc/nginx/README.dynamic. include /usr/share/nginx/modules/*.conf; 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 ec2-54-250-209-6.ap-northeast-1.compute.amazonaws.com; 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 { } } # Settings for a TLS enabled server. # # server { # listen 443 ssl http2 default_server; # listen [::]:443 ssl http2 default_server; # server_name _; # root /usr/share/nginx/html; # # ssl_certificate "/etc/pki/nginx/server.crt"; # ssl_certificate_key "/etc/pki/nginx/private/server.key"; # ssl_session_cache shared:SSL:1m; # ssl_session_timeout 10m; # ssl_ciphers PROFILE=SYSTEM; # ssl_prefer_server_ciphers on; # # # 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 { # } # } }

追記
/var/log/nginx/access.logは以下になります

122.51.94.168 - - [07/Jun/2020:06:04:15 +0000] "GET /html/public/index.php HTTP/1.1" 404 3665 "-" "Mozilla/5.0 (Windows; U; Windows NT 6.0;en-US; rv:1.9.2) Gecko/20100115 Firefox/3.6)" "-" 122.51.94.168 - - [07/Jun/2020:06:04:16 +0000] "GET /public/index.php HTTP/1.1" 404 3665 "-" "Mozilla/5.0 (Windows; U; Windows NT 6.0;en-US; rv:1.9.2) Gecko/20100115 Firefox/3.6)" "-" 122.51.94.168 - - [07/Jun/2020:06:04:16 +0000] "GET /TP/html/public/index.php HTTP/1.1" 404 3665 "-" "Mozilla/5.0 (Windows; U; Windows NT 6.0;en-US; rv:1.9.2) Gecko/20100115 Firefox/3.6)" "-" 122.51.94.168 - - [07/Jun/2020:06:04:17 +0000] "GET /elrekt.php HTTP/1.1" 404 3665 "-" "Mozilla/5.0 (Windows; U; Windows NT 6.0;en-US; rv:1.9.2) Gecko/20100115 Firefox/3.6)" "-" 122.51.94.168 - - [07/Jun/2020:06:04:18 +0000] "GET /index.php HTTP/1.1" 500 3708 "-" "Mozilla/5.0 (Windows; U; Windows NT 6.0;en-US; rv:1.9.2) Gecko/20100115 Firefox/3.6)" "-" 122.51.94.168 - - [07/Jun/2020:06:04:19 +0000] "GET / HTTP/1.1" 500 3708 "-" "Mozilla/5.0 (Windows; U; Windows NT 6.0;en-US; rv:1.9.2) Gecko/20100115 Firefox/3.6)" "-" 218.35.154.40 - - [07/Jun/2020:08:06:44 +0000] "GET / HTTP/1.1" 400 157 "-" "-" "-" 195.54.160.135 - - [07/Jun/2020:08:08:14 +0000] "GET /solr/admin/info/system?wt=json HTTP/1.1" 404 3665 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.108 Safari/537.36" "-" 195.54.160.135 - - [07/Jun/2020:08:14:04 +0000] "GET /?a=fetch&content=<php>die(@md5(HelloThinkCMF))</php> HTTP/1.1" 500 3708 "-" "Mozilla/5.0 (Windows NT10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.108 Safari/537.36" "-" 195.54.160.135 - - [07/Jun/2020:08:14:05 +0000] "GET /?XDEBUG_SESSION_START=phpstorm HTTP/1.1" 500 3708 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.108 Safari/537.36" "-" 115.165.12.59 - - [07/Jun/2020:08:26:54 +0000] "GET / HTTP/1.1" 500 3708 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.138 Safari/537.36" "-" 195.54.160.135 - - [07/Jun/2020:08:27:16 +0000] "GET /index.php?s=/Index/\x5Cthink\x5Capp/invokefunction&function=call_user_func_array&vars[0]=md5&vars[1][]=HelloThinkPHP HTTP/1.1" 500 3708 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.108 Safari/537.36" "-" 66.249.66.203 - - [07/Jun/2020:08:42:59 +0000] "GET /robots.txt HTTP/1.1" 404 3665 "-" "Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)" "-" 66.249.66.201 - - [07/Jun/2020:08:42:59 +0000] "GET / HTTP/1.1" 500 3708 "-" "Mozilla/5.0 (Linux; Android 6.0.1; Nexus 5X Build/MMB29P) AppleWebKit/537.36(KHTML, like Gecko) Chrome/80.0.3987.92 Mobile Safari/537.36 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)" "-"

「/var/log/nginx/error.log」は以下になります。

/latest/dynamic/instance-identity/document HTTP/1.1", host: "[::ffff:a9fe:a9fe]" 2020/06/07 01:58:01 [error] 4548#0: *47 "/usr/share/nginx/html/HNAP1/index.php" is not found (2: No such file or directory), client: 178.32.89.137, server: ec2-54-250-209-6.ap-northeast-1.compute.amazonaws.com, request: "GET /HNAP1/ HTTP/1.1", host: "54.250.209.6", referrer: "http://54.250.209.6/" 2020/06/07 06:04:13 [error] 4548#0: *61 FastCGI sent in stderr: "Primary script unknown" while reading response header from upstream, client: 122.51.94.168, server: ec2-54-250-209-6.ap-northeast-1.compute.amazonaws.com, request: "GET /TP/public/index.php HTTP/1.1", upstream: "fastcgi://unix:/run/php-fpm/www.sock:", host: "54.250.209.6" 2020/06/07 06:04:14 [error] 4548#0: *63 FastCGI sent in stderr: "Primary script unknown" while reading response header from upstream, client: 122.51.94.168, server: ec2-54-250-209-6.ap-northeast-1.compute.amazonaws.com, request: "GET /TP/index.php HTTP/1.1", upstream: "fastcgi://unix:/run/php-fpm/www.sock:",host: "54.250.209.6" 2020/06/07 06:04:15 [error] 4548#0: *65 FastCGI sent in stderr: "Primary script unknown" while reading response header from upstream, client: 122.51.94.168, server: ec2-54-250-209-6.ap-northeast-1.compute.amazonaws.com, request: "GET /thinkphp/html/public/index.php HTTP/1.1", upstream: "fastcgi://unix:/run/php-fpm/www.sock:", host: "54.250.209.6" 2020/06/07 06:04:15 [error] 4548#0: *67 FastCGI sent in stderr: "Primary script unknown" while reading response header from upstream, client: 122.51.94.168, server: ec2-54-250-209-6.ap-northeast-1.compute.amazonaws.com, request: "GET /html/public/index.php HTTP/1.1", upstream: "fastcgi://unix:/run/php-fpm/www.sock:", host: "54.250.209.6" 2020/06/07 06:04:16 [error] 4548#0: *69 FastCGI sent in stderr: "Primary script unknown" while reading response header from upstream, client: 122.51.94.168, server: ec2-54-250-209-6.ap-northeast-1.compute.amazonaws.com, request: "GET /public/index.php HTTP/1.1", upstream: "fastcgi://unix:/run/php-fpm/www.sock:", host: "54.250.209.6" 2020/06/07 06:04:16 [error] 4548#0: *71 FastCGI sent in stderr: "Primary script unknown" while reading response header from upstream, client: 122.51.94.168, server: ec2-54-250-209-6.ap-northeast-1.compute.amazonaws.com, request: "GET /TP/html/public/index.php HTTP/1.1", upstream: "fastcgi://unix:/run/php-fpm/www.sock:", host: "54.250.209.6" 2020/06/07 06:04:17 [error] 4548#0: *73 FastCGI sent in stderr: "Primary script unknown" while reading response header from upstream, client: 122.51.94.168, server: ec2-54-250-209-6.ap-northeast-1.compute.amazonaws.com, request: "GET /elrekt.php HTTP/1.1", upstream: "fastcgi://unix:/run/php-fpm/www.sock:", host: "54.250.209.6" 2020/06/07 08:08:14 [error] 4548#0: *80 open() "/usr/share/nginx/html/solr/admin/info/system" failed (2: No such file or directory), client: 195.54.160.135, server: ec2-54-250-209-6.ap-northeast-1.compute.amazonaws.com, request: "GET /solr/admin/info/system?wt=json HTTP/1.1", host: "54.250.209.6:80" 2020/06/07 08:42:59 [error] 4548#0: *90 open() "/usr/share/nginx/html/robots.txt" failed (2: No such file or directory), client: 66.249.66.203, server: ec2-54-250-209-6.ap-northeast-1.compute.amazonaws.com, request: "GET /robots.txt HTTP/1.1", host: "ec2-54-250-209-6.ap-northeast-1.compute.amazonaws.com"

気になる質問をクリップする

クリップした質問は、後からいつでもMYページで確認できます。

またクリップした質問に回答があった際、通知やメールを受け取ることができます。

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

yukky1201

2020/06/07 07:33

nginxのアクセスログとエラーログをそれぞれ確認したいです
study_111

2020/06/07 08:30

追記しました。
study_111

2020/06/07 08:56

ログを最新の部分に置き換え、修正しました。
guest

回答1

0

php実行環境が整ってないようです

以下のコードのphpを正しく処理できるnginx+php-fpm環境を構築しましょう

<?php phpinfo(); ?>

投稿2020/06/07 12:15

yukky1201

総合スコア2751

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

まだベストアンサーが選ばれていません

会員登録して回答してみよう

アカウントをお持ちの方は

15分調べてもわからないことは
teratailで質問しよう!

ただいまの回答率
85.48%

質問をまとめることで
思考を整理して素早く解決

テンプレート機能で
簡単に質問をまとめる

質問する

関連した質問