PHP-FPMが設定されたNginx HTTPサーバーがあり、ほとんどすべて正常に動作します。私はpath/to/file
に行くことができるようにしたいと私にそれを与えるindex.php?url=path/to/file
を与える。しかし、実際のPHPをダウンロードすると、ブラウザでは実行されません。私はこれを引き起こしているのか分かりません。PHP-FPMとNginxの書き直しによる書き換え
nginxの構成:
server {
listen 80;
server_name sandbox.domain.tld;
access_log /path/to/domain/log/sandbox.access.log;
error_log /path/to/domain/log/sandbox.error.log;
location/{
root /path/to/sandbox;
index index.php;
if (!-e $request_filename) {
rewrite ^/beta/(.+)$ /beta/index.php?url=$1 break;
}
}
location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
include /usr/local/nginx/conf/fastcgi_params;
fastcgi_param SCRIPT_FILENAME /path/to/sandbox$fastcgi_script_name;
}
nginxの設定を投稿してもよろしいですか? PHPがアクセスされているときにルーティングがCGIリクエストを呼び出すように設定されていないようです。 – plasmid87
私はconfファイルを追加しました。 – will