更改nginx + hhvm上的文档源代码?

我打算configurationhhvm和nginx工作在/home/ubuntu/www.mysite.com目录下的php文件

fastcgi_param SCRIPT_FILENAME /home/ubuntu/www/www.mysite.com$fastcgi_script_name; 

然后我添加源根到vim /etc/hhvm/server.ini

 hhvm.server.source_root = /home/ubuntu/www/www.mysite.come 

然后重新启动nginx和hhvm,但仍然从默认web根目录得到的PHP文件不是从/ home / subuntu / www / www.mysite.come

这里是虚拟主机的configuration文件

  server { listen 80; server_name www.mysite.se; access_log /var/log/www.mysite.se.access_log; error_log /var/log/www.mysite.se.error_log; location / { root /home/ubuntu/www/www.mysite.se; index index.php index.htm; if (!-f $request_filename){ set $rule_1 1$rule_1; } if (!-d $request_filename){ set $rule_1 2$rule_1; } if ($rule_1 = "21"){ rewrite /. /index.php last; } } #include hhvm.conf; location ~ \.php$ { fastcgi_keep_conn on; fastcgi_pass 127.0.0.1:9000; # fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME /home/ubuntu/www/www.mysite.se$fastcgi_script_name; include fastcgi_params; } } 

当我做了一个请求的HTML文件从/ home / subuntu / www / www.mysite.se加载没有问题,但PHP文件从默认的nginx文件夹

这个问题在nginx站点configuration文件上

根需要在服务器块而不是位置块。

那些你愿意用hhvm来configurationnginx的人是怎么做的。

我回复你使用Ubuntu的。

服务器{听80;

 server_name www.mysite.se; root /home/ubuntu/www/www.mysite.se; access_log /var/log/www.mysite.se.access_log; error_log /var/log/www.mysite.se.error_log; location / { index index.php index.htm; if (!-f $request_filename){ set $rule_1 1$rule_1; } if (!-d $request_filename){ set $rule_1 2$rule_1; } if ($rule_1 = "21"){ rewrite /. /index.php last; } } #include hhvm.conf; location ~ \.php$ { fastcgi_keep_conn on; fastcgi_pass 127.0.0.1:9000; # fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME /home/ubuntu/www/www.mysite.se$fastcgi_script_name; include fastcgi_params; } }