安装nginx,配置反向代理
1.下载linux的nginx
http://nginx.org/en/download.html
2.上传linux服务器
3.执行配置脚本
/configure
4.编译nginx源码
make
5.安装nginx
make install
6.启动nginx
7.配置反向代理
upstream nacoscluster {
server 服务器ip:8845;
server 服务器ip:8846;
server 服务器ip:8847;
}
server {
listen 8686;
server_name localhost;
location / {
proxy_pass http://nacoscluster;
}
}
当访问localhost:8686,将请求转发到某个nacos
8.重写加载配置文件
./nginx -s reload
测试localhost:8686/nacos/index.html
测试是否可以通过nginx将请求转发到某个nacos管理控制台