Closed supreme94 closed 6 years ago
假定你有两台机器,正常情况下也就需要两个域名,前端资源服务器A, node应用服务器B ,基本就是在A服务器的nginx配置中把异步接口的请求转发到B服务器上,然后B服务器再配置nginx拦截请求就好了
// A 服务器
server { listen 80; listen [::]:80; server_name icon.bolin.site; location / { root /home/liaobolin/app/nicon-front/dist; index index.html index.htm; } location ^~ /static { root /home/liaobolin/app/nicon-front/dist; } location /api { // 转发到B服务 b.bolin.site } location ^~ /resource { // 转发到B服务 b.bolin.site } }
// B 服务器
server { listen 80; listen [::]:80; server_name b.bolin.site; location /api { proxy_set_header X-Real-IP $remote_addr; proxy_set_header Host $http_host; proxy_pass http://127.0.0.1:4843; } location ^~ /resource { root /home/b/app/nicon; } }
大体思路就是这样,你可以试试
@bolin-L 如果我想用账号登录,但是想用七牛上传 这样写对吗?export productType='qiniu';
@supreme94 在develop分支中正在开发可视化配置安装的功能,现在基本完成了 你可以试试, 按照你的情况,你只需要配置productType 为default_qiniu 就好了 ,等我测试稳定了才会合回master,有什么提随时可以联系我
假定你有两台机器,正常情况下也就需要两个域名,前端资源服务器A, node应用服务器B ,基本就是在A服务器的nginx配置中把异步接口的请求转发到B服务器上,然后B服务器再配置nginx拦截请求就好了
// A 服务器
// B 服务器
大体思路就是这样,你可以试试