nginx 部署 二级访问目录
nginx 配置 windows
server {
listen 80;
server_name web.ttt.com;
## web1
location / {
root "D:/phpstudy_pro/WWW/web1";
index index.html;
try_files $uri $uri/ /index.html;
}
## api 配置
location ~/api {
rewrite ^/api/(.*)$ /$1 break;
proxy_set_header Host $host;
proxy_pass_header User-Agent;
## 代理到后台接口
proxy_pass http://127.0.0.1:9090;
}
## web2
location /web2 {
alias "D:\phpstudy_pro\WWW\web2";
index index.html;
try_files $uri $uri/ /index.html;
}
}