Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use nginx "root" and "location" on windows?

Tags:

nginx

Here is the conf:

location /Desktop/ {
    root   c:/Users/elqstux/;
}

the file path is C:\Users\elqstux\Desktop\wy.html.

when i access http://127.0.0.1/Desktop/wy.html in browser, i got 404 Not Found.

who can tell what's wrong?

like image 533
BlackMamba Avatar asked Jul 21 '15 05:07

BlackMamba


People also ask

Where do I put nginx location?

By default the file is named nginx. conf and for NGINX Plus is placed in the /etc/nginx directory. (For NGINX Open Source , the location depends on the package system used to install NGINX and the operating system. It is typically one of /usr/local/nginx/conf, /etc/nginx, or /usr/local/etc/nginx.)


1 Answers

Use double back slashes to avoid certain character issues (\r is a carriage return.):

root C:\\Users\\elelqstux;
like image 192
Nicholas Kalscheuer Avatar answered Sep 20 '22 19:09

Nicholas Kalscheuer