- Enter the nginx configuration directory
cd /usr/local/nginx/conf
2. Edit nginx configuration filevi nginx.conf
3. Add proxy for Nacos
upstream nacosServerList {
server 192.168.172.102:8848;
server 192.168.172.103:8848;
server 192.168.172.104:8848;
}
# Nacos地址服务器寻址配置
server {
#监听端口
listen 8099;
location /nacos/ {
# Nacos地址服务器寻址配置
proxy_pass http://nacosServerList/nacos/;
}
}
- Overload configuration
./nginx -s reload