前提
お試しでAWSでWebサーバーを構築しています
・Windows10+Nginx+php-fpmの構成です。
・ログインシステムを搭載した簡単なWebページを作成しています。
・Cの下にnginxとphpのフォルダを配置しています。
・nginx>htmlフォルダ内にindex.htmlやindex.phpを配置しています。
・独自ドメインを取得し、ブラウザから
https://www.〇〇〇.com
で検索してindex.htmlを閲覧出来ています。
実現したいこと
ログインフォームを作成しindex.phpという名前でindex.htmlに配置しました。そこでこのページに
https://www.〇〇〇.com/index.php
でブラウザからアクセス出来るようにしたいです。
発生している問題・エラーメッセージ
前日までアクセス出来ていましたがアクセス出来なくなりました。
以下がブラウザからアクセスしたときのエラーメッセージです。
An error occurred. Sorry, the page you are looking for is currently unavailable. Please try again later. If you are the system administrator of this resource then you should check the error log for details. Faithfully yours, nginx.
今回設定時に変更したのはnginxのconfファイルのPHPに関する部分だけです。前日までアクセス出来ていたことを考えると何が原因で失敗しているのか分からず混乱しています。
nginxとphp-fpmの起動は確認出来ているため設定の問題ではないかと考えています。
参考として以下にnginx.confを記します。
該当のソースコード
#user nobody; worker_processes 1; #error_log logs/error.log; error_log logs/error.log notice; #error_log logs/error.log info; #pid logs/nginx.pid; events { worker_connections 1024; } http { include mime.types; default_type application/octet-stream; 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 logs/access.log main; sendfile on; #tcp_nopush on; #keepalive_timeout 0; keepalive_timeout 65; #gzip on; server { listen 80; server_name localhost; #charset koi8-r; #access_log logs/host.access.log main; location / { root html; index index.html index.php; } #error_page 404 /404.html; # redirect server error pages to the static page /50x.html # error_page 500 502 503 504 /50x.html; location = /50x.html { root html; } # proxy the PHP scripts to Apache listening on 127.0.0.1:80 # #location ~ \.php$ { # proxy_pass http://127.0.0.1; #} # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000 # location ~ \.php$ { root html; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; } # deny access to .htaccess files, if Apache's document root # concurs with nginx's one # #location ~ /\.ht { # deny all; #} } # another virtual host using mix of IP-, name-, and port-based configuration # #server { # listen 8000; # listen somename:8080; # server_name somename alias another.alias; # location / { # root html; # index index.html index.htm; # } #} # HTTPS server # #server { # listen 443 ssl; # server_name localhost; # ssl_certificate cert.pem; # ssl_certificate_key cert.key; # ssl_session_cache shared:SSL:1m; # ssl_session_timeout 5m; # ssl_ciphers HIGH:!aNULL:!MD5; # ssl_prefer_server_ciphers on; # location / { # root html; # index index.html index.htm; # } #} }

回答1件
あなたの回答
tips
プレビュー