@リチャード・スミスは、彼のアドバイスによって私に大きな支持を与えてくれました。私は拡張機能のないphpを検索しています。誰もがこれまで私のようにこれを知っているわけではありません。
server {
listen 80;
root /vagrant/public;
# Add index.php to the list if you are using PHP
index index.php index.html index.htm;
server_name your_domain_name; #for example example.com
location/{
try_files $uri $uri/ @extensionless-php;
index index.php index.html;
}
location @extensionless-php {
rewrite ^(.*)$ $1.php last;
}
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
# You must use this, because if You not use it, You will get surce code instead of result of php script execution.
location ~ \.php(/|$) {
fastcgi_pass unix:/run/php/php7.0-fpm.sock;
fastcgi_split_path_info ^(.+\.php)(/.*)$;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}
}
ここで "エクステンデッドのPHP"を検索することができます - 多くの解決策があります。 –
@リチャードスミスありがとう:) – Dominik