需求: 在vm 集群中有一台服务器A可以连接外网,其他机器 BCD只有内网。
想通过 A 访问B上的网站
nginx 配置
server {
    listen  10081;
    server_name     k8s.baimeidashu.com;
    location / {
        proxy_set_header Host $host;
        proxy_pass      http://172.16.1.200:8080;
  }
}

B上的配置,参考:连接
比如 k8s 30880 ,
网站可以正常访问:
http://10.0.0.201:30880/login
在跳板机上,做 nginx 转发:
http://192.168.3.199:30880/login

nginx 配置:
[root@jumperserverzzy conf.d]# cat 201-30880.conf 
server {
    listen  30880;
    server_name     k8s.baimeidashu.com;
    location / {
        proxy_set_header Host $host;
        proxy_pass      http://10.0.0.201:30880;
  }
}
欢迎来撩 : 汇总all

 白眉大叔
				白眉大叔			
 
									 
									