Sample Header Ad - 728x90

nginx/HHVM 404, fixed replacing $document_root with absolute path, but redirect adds path to URL

1 vote
1 answer
1026 views
I've had the same issue as described in [this question](https://stackoverflow.com/q/28308099) , 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.conf server { 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.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; }
Asked by Oxwivi (1792 rep)
Oct 28, 2015, 12:06 PM
Last activity: Oct 28, 2015, 04:40 PM