1

all.

Plese advice, how to correctly set root dir for location.

Now I have incorrect config:

location ~* ^/upload/ 
{
root /home/site/upload/
}

I want to locate all files from URLs, what are started from /upload/ from directory /home/site/upload/

But Nginx try to locate files from /home/site/upload/upload/ , for example /home/site/upload/upload/1.doc

How to fix my config?

Arthur
  • 3,253
  • 7
  • 43
  • 75
  • possible duplicate of [Nginx -- static file serving confusion with root & alias](http://stackoverflow.com/questions/10631933/nginx-static-file-serving-confusion-with-root-alias) – jonathan3692bf Feb 06 '15 at 10:13

1 Answers1

1

Founded solution!

http://nginx.org/ru/docs/http/ngx_http_core_module.html#alias

Result:

location /upload/ 
{
alias /home/site/upload/;
}
Arthur
  • 3,253
  • 7
  • 43
  • 75