nginx 配置root,alias,proxy

nginx配置

参考文档地址

http://nginx.org/en/docs/

Syntax: location [ = | ~ | ~* | ^~ ] uri { ... }

root

// 请求 /my -----> nginx/html/my/index.html
location /my {
root html;
index index.html;
}

alias

// 请求 /my -----> nginx /html/index.html
location /my {
alias html;
index index.html;
}

proxy

// 请求 /good -----> 指向 ip服务地址
location /good {
proxy_pass http://ip/;
}

原文地址:https://www.cnblogs.com/pengsn/p/13280209.html