I followed the instructions here at https://github.com/hhvm/hack-example-site and somehow lost my way when setting up hhvm hack site on ngnix over ubunut 14.04 . Please note that I used the appropriate apt-get repo for 14.04.
However after configuring and trying to access 127.0.0.1:9000 I see an error in the /var/log/hhvm/error.log
FastCGI protocol: received an invalid record
My /etc/ngnix/sites-enabled is as follows
-rw-r--r-- 1 root root 0 Aug 30 22:01 default
lrwxrwxrwx 1 root root 44 Aug 30 22:21 hack-example-site -> /etc/nginx/sites-available/hack-example-site
The contents of /etc/ngnix/sites-available/hack-example-site is as follows:
server {
root ~/hack-example-site/hack-example-site;
index index.php;
location ~ \.php$ {
# If fastcgi backend is on another server disable this.
# Read issue #6 about this
try_files $uri =404;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
#fastcgi_param SCRIPT_FILENAME ~/hack-example-site/hack-example-site/index.php
fastcgi_param ~/hack-example-site/hack-example-site $document_root$fastcgi_script_name;
include fastcgi_params;
}
}
Could someone please help me with this hhvm site running on my local host? Thanks.
Oh and please note the ngnix is installed properly and the server responds to localhost.
The configuration file /etc/nginx/sites-available/hack-example-site below:
server {
root /root/hack-example-site;
index index.php;
server_name localhost;
location ~ \.php$ {
# If fastcgi backend is on another server disable this.
# Read issue #6 about this
try_files $uri =404;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
#fastcgi_param SCRIPT_FILENAME ~/hack-example-site/hack-example-
site/index.php
fastcgi_param /root/hack-example-site
$document_root$fastcgi_script_name;
include fastcgi_params;
} } ~