Welcome! Log In Create A New Profile

Advanced

nginx not using root from location

July 12, 2016 10:47AM
Hello. I'm obviously missing something but I'm not quite sure what.

Here's one of my vhosts.

server {
listen 80;
server_name test.local;

access_log /var/log/nginx/access.log;

root /data/www/htdocs/web;

location / {
index index.php;
}

location /testlocation {
index index.html
root /data/www/htdocs/test;
}
}

When I try to get index.html from /testlocation I always get 404 with message in errorlog that file is missing in /data/www/htdocs/web. Why?
Subject Author Posted

nginx not using root from location

reaper July 12, 2016 10:47AM

Re: nginx not using root from location

Shivam Nanda July 12, 2016 12:48PM

Re: nginx not using root from location

Francis Daly July 12, 2016 01:32PM

Re: nginx not using root from location

reaper July 12, 2016 03:47PM

Re: nginx not using root from location

Francis Daly July 12, 2016 04:12PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 317
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready