root@Server04:/html# cat /etc/nginx/conf.d/www.conf
server {
listen 80;
server_name www.skills.com;
root /html;
index index.php index.html;
location = /phpadmin {
fastcgi_pass unix:/run/php/php7.3-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME %document_root$fastcgi_script_name;
include fastcgi_params;
}
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/run/php/php7.3-fpm.sock;
}
}
当我想访问 phpadmin 下的index.php文件时
必须得加上 ” = “ 精准匹配
我觉得 应该是 document_root 获取不正确导致的,
2019/01/03 10:24:02 [error] 11931#11931: *260 FastCGI sent in stderr: "Primary script unknown" while reading response header from upstream,
client: 1.2.3.4, server: localhost, request: "GET /index.php HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: www.example.com