t1nyf00

t1nyf00

V2EX 第 134471 号会员,加入于 2015-08-22 23:39:06 +08:00
根据 t1nyf00 的设置,主题列表被隐藏
二手交易 相关的信息,包括已关闭的交易,不会被隐藏
t1nyf00 最近回复了
2022-07-19 00:28:35 +08:00
回复了 among 创建的主题 NGINX 一个 ip 根据 url,配置 3 个平台
或许可以这样子 (
```
location / {
# 不知道你的首页准备放什么内容
root /data/dist;
try_files $uri $uri/ /index.html;
}

location /aaa/ {
# 使用 alias 的原因是, 请求 /aaa/index.html 时会访问 /data/aaa/dist/index.html 文件
# 如果使用 root /data/aaa/dist 的话, 在访问 /aaa/index.html 时会访问 /data/aaa/dist/aaa/index.html
# ref: https://nginx.org/en/docs/http/ngx_http_core_module.html#alias
alias /data/aaa/dist;
try_files $uri $uri/ /aaa/index.html
}

location /aaa/api/ {
# 注意最后的 / 以及你跑在同一台机器上后端口需要做区分
proxy_pass http://10.10.10.10:1111/api/;
}


location /bbb/ {
alias /data/bbb/dist;
try_files $uri $uri/ /bbb/index.html
}

location /bbb/api/ {
proxy_pass http://10.10.10.10:1112/api/;
}


location /ccc/ {
alias /data/ccc/dist;
try_files $uri $uri/ /ccc/index.html
}

location /ccc/api/ {
proxy_pass http://10.10.10.10:1113/api/;
}
```
关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   5525 人在线   最高记录 6543   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 10ms · UTC 01:30 · PVG 09:30 · LAX 18:30 · JFK 21:30
Developed with CodeLauncher
♥ Do have faith in what you're doing.