如何在Windows上使用nginx“root”和“location”?

时间:2015-07-21 05:45:11

标签: nginx

这是conf:

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

文件路径为C:\Users\elqstux\Desktop\wy.html

当我在浏览器中访问http://127.0.0.1/Desktop/wy.html时,我获得了404 Not Found

谁能分辨出什么是错的?

1 个答案:

答案 0 :(得分:0)

使用双反斜杠来避免某些字符问题(\ r是回车符):

root C:\\Users\\elelqstux;