NGINX错误日志内容如下:
2018/09/30 20:01:02 [error] 19321#19321: *2877 FastCGI sent in stderr: "Primary script unknown" while reading response header from upstream, client: 117.163.227.90, server: 4spaces.org, request: "GET /plus/90sec.php HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "www.4spaces.org", referrer: "http://bijie.jinti.com/plugins/weathermap/configs/test404.php"
解决办法如下:
修改nginx配置文件,
location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;
include fastcgi_params;
}
将上面的内容修改为:
location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root/$fastcgi_script_name;
include fastcgi_params;
}
$document_root 代表当前请求在root指令中指定的值:
server {
listen 443 ssl http2;
server_name 4spaces.org www.4spaces.org;
index index.php index.html index.htm;
root /etc/nginx/html/rxblog;
add_header X-Frame-Options DENY;
add_header X-Content-Type-Options nosniff;
ssl_certificate /etc/letsencrypt/live/4spaces.org/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/4spaces.org/privkey.pem;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers EECDH+CHACHA20:EECDH+CHACHA20-draft:EECDH+AES128:RSA+AES128:EECDH+AES256:RSA+AES256:EECDH+3DES:RSA+3DES:!MD5;
ssl_prefer_server_ciphers on;
ssl_session_cache shared:SSL:10m;
ssl_session_timeout 60m;
location / {
try_files $uri $uri/ /index.php?$args;
}
location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root/$fastcgi_script_name;
include fastcgi_params;
}
}
上面的配置表示:针对/etc/nginx/html/rxblog/目录下的php文件进行解析。
参考文章:
最新评论
网飞没问题, 迪士尼+有解决方案么?
pp助手是安卓手机用的,根本下载用不来苹果
已解决
这样的话数据库里的结构为{"attachment":{"content":"xxx"}}, 要怎么才能变成{"content":"xxx"},从而使结构保持一致?
赞! make test不过的坑都写到的,谢谢楼主~
谢谢你
用了root用户还是一直502是怎么回事呢
student id 是空的