我知道这不是一个普遍的问题,但是我似乎无法以某种方式找到直接的答案.有人能够尽可能直接地回答这个问题吗?
我的NGINX(提供静态文件)和HHVM(从控制台中的hhvm index.php)工作正常,但是我无法通过NGINX访问.php而没有得到404
情况:
HHVM 3.5.0
Nginx 1.7.9
我在/etc/nginx/conf.d/default.conf中有这个
server {
listen 80;
server_name localhost;
location / {
root /var/www;
index index.php index.html index.htm;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
include hhvm.conf;
}
在HHVM.conf中
location ~ \.(hh|php)${
fastcgi_keep_conn on;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
最佳答案
将以下HHVM conf替换为您的:
location ~ \.(hh|php)${
fastcgi_keep_conn on;
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和$fastcgi_script_name之间有一个空格.
更新资料
通过使用/ var / www更改$document_root来解决
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。