使用 Nginx 通过具体路径返回静态页面

Returning static page by concrete path with Nginx

这很容易,但我还没有找到这个简单问题的直接答案

我link喜欢

mysite/api/location/login

我需要 return 静态页面

login.html

位于目录

root /data/www/

location =/api/location/login {
root /data/www/;
 how to return static page here?
}

不要在此处使用 "root",您将得到 /data/www/api/location/login 作为结果。使用 "alias" 代替

location = /api/location/login {
    alias /data/www/;
    index login.html;
}

http://nginx.org/en/docs/http/ngx_http_index_module.html#index