我为使用ngnix运行HHVM的Ubuntu 14.04 VPS设置了以下ngnix配置:
server {
listen 80 default_server;
listen [::]:80 default_server ipv6only=on;
root /home/lephenix/main_website;
index.php index.html index.htm;
# Make site accessible from http://localhost/
server_name localhost;
include hhvm.conf;
location / {
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
try_files $uri $uri/ /index.php?q=$uri&$args;
# Uncomment to enable naxsi on this location
# include /etc/nginx/naxsi.rules
}
}
Run Code Online (Sandbox Code Playgroud)
问题是,当我启用此配置时,我从ngnix收到错误:
2014/09/07 13:16:01 [emerg] 13584#0: unknown directive "index.php" in /etc/nginx/sites-enabled/default:6
Run Code Online (Sandbox Code Playgroud)
我看了,这似乎是这种配置的正确结构.即使我删除index.php,错误也会变为:
2014/09/07 13:17:03 [emerg] …Run Code Online (Sandbox Code Playgroud)