Q&A
apacheで運営したwordpressをNginxに変えようとしています。
index.phpにアクセスするのではなくダウンロードしてしまういます。
これはphp環境が揃ってないからでしょうか?
もしくはNginx側の設定ミスですか?
環境は
awsで
ubuntu -> docker(ubuntu) -> nginx
です。
立てたdockerは
dockerhubから以下のnginx-php環境をpullしてきたので
docker pull richarvey/nginx-php-fpm
php環境が揃ってないとは信じ難いです。
何かヒントになることがありましたら教えて下さい。
htmlファイルは普通にアクセスできます。
nginx設定は以下の通りです。
server { listen 80; server_name xx.xx; location / { root /app; index index.html index.htm; } # 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 /scripts$fastcgi_script_name; # include fastcgi_params; #} location ~ .php$ { root /app; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; } }
回答6件
下記のような回答は推奨されていません。
このような回答には修正を依頼しましょう。