server {
server_name mediaserver.localdomain;
listen 80;
index index.php index.htm index.html;
root /var/www/html/Organizr;
location = / {
root /var/www/html/Organizr;
}
location /homelab {
alias /opt/homelab/;
}
location ~ /\.git {
deny all;
}
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/run/php/php7.0-fpm.sock;
}
}
The include snippets/fastcgi-php.com; =
# regex to split $uri to $fastcgi_script_name and $fastcgi_path
fastcgi_split_path_info ^(.+\.php)(/.+)$;
# Check that the PHP script exists before passing it
try_files $fastcgi_script_name =404;
# Bypass the fact that try_files resets $fastcgi_path_info
# see: http://trac.nginx.org/nginx/ticket/321
set $path_info $fastcgi_path_info;
fastcgi_param PATH_INFO $path_info;
fastcgi_index index.php;
include fastcgi.conf;
That is my config and for the life of me I cannot get it to work.
My expectation is to have the http :// mediaserver.localdomain/ to go to the "/var/www/html/Organizr/index.php"
And when I go to http :// mediaserver.localdomain/homelab/ it pulls the "/opt/homelab/index.php"
But only the http :// mediaserver.localdomain/ works not the /homelab/
I have exhausted my google admin techniques and the nginx documentation pages on alias and root definitions.
Thanks in advance.
FYI (i put the spaces in the links deliberately to get rid of auto links)