nginx not using root from location

Shivam Nanda shivamnindrajog at gmail.com
Tue Jul 12 16:46:43 UTC 2016


Hi Reaper

please check the following:

1. check the permissions of the folders.
2. define both root directive in the location.

restart the nginx service and share the results.

Thanks

Shivam
On 12 Jul 2016 20:18, "reaper" <nginx-forum at forum.nginx.org> wrote:

> 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?
>
> Posted at Nginx Forum:
> https://forum.nginx.org/read.php?2,268258,268258#msg-268258
>
> _______________________________________________
> nginx mailing list
> nginx at nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.nginx.org/pipermail/nginx/attachments/20160712/e5294f14/attachment.html>


More information about the nginx mailing list