I've had the same issue as described in this question, and the solution of replacing $document_root with it's absolute path worked until redirects added the absolute path to the URL, as in:EXPECTED http://domain/pma/REALITY  http://domain/var/www/pma/I'm about to pull my hair out of frustration here. Please help me not become bald. (Although keeping the hair in line is a hassle in itself, but you get the idea)$ less /etc/nginx/conf.d/default.confserver {    listen       80;    server_name  localhost;    #charset koi8-r;    #access_log  /var/log/nginx/log/host.access.log  main;    location / {        root   /usr/share/nginx/html;        index  index.html index.htm index.php;    }    #error_page  404              /404.html;    # redirect server error pages to the static page /50x.html    #    error_page   500 502 503 504  /50x.html;    location = /50x.html {        root   /usr/share/nginx/html;    }    include hhvm.conf;    # proxy the PHP scripts to Apache listening on 127.0.0.1:80    #    #location ~ \.php$ {    #    proxy_pass   http://127.0.0.1;    #}    # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000    #    #location ~ \.php$ {    #    root           html;    #    fastcgi_pass   127.0.0.1:9000;    #    fastcgi_index  index.php;    #    fastcgi_param  SCRIPT_FILENAME  /scripts$fastcgi_script_name;    #    include        fastcgi_params;    #}    # deny access to .htaccess files, if Apache's document root    # concurs with nginx's one    #    #location ~ /\.ht {    #    deny  all;    #}}$ less /etc/nginx/hhvm.conflocation ~ \.(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;}
nginx/HHVM 404, fixed replacing $document_root with absolute path, but redirect adds path to URL
configuration;nginx;hhvm
The root directive is defined inside location, this causes your problem.Defining the root directive directly at the level of serversets the proper value of variable $document_root, which will also get available inside hhvm.conf.server {    listen       80;    server_name  localhost;    root   /var/www;    location / {        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;}Then, no modification is needed in your hhvm.conf, although you may do some cleanup there too.