使用frp实现公网使用https访问exsi控制台

目录


背景

esxi控制台默认是通过https登陆的,但是因为它默认的证书是自签名的,所以在浏览器会标记为红色的叉;同时这对于配置安全的公网访问来说也是必须要解决的事情。这段时间碰巧遇到这个问题,上网找了好久没有找到合适的解决方案,不过经过我的尝试,终于找到了简单可行的方法。

方法

esxi配置

上传替换证书

这里略过ssl证书申请过程,将申请好的证书crt文件和key文件通过ssh上传到esxi的/etc/vmware/ssl/目录下,这里假设上传的文件是a.keya.crt

bash 复制代码
$ cd /etc/vmware/ssl/
$ mv rui.key rui.key.bak
$ mv rui.crt rui.crt.bak
$ mv a.key rui.key
$ mv a.crt rui.crt

重启相关服务

bash 复制代码
$ /etc/init.d/hostd restart
$ /etc/init.d/vpxa restart

frp配置

frps配置

ini 复制代码
# frps.ini
[common]
bind_addr = 0.0.0.0
bind_port = 7000
vhost_https_port = 8080

frpc配置

ini 复制代码
# frpc.ini
[common]
server_addr = x.x.x.x
server_port = 7000

[esxi_web]
type = https
local_ip = x.x.x.x # 这里替换为你本地esxi机器的ip
local_port = 443
custom_domains = www.example.com # 这里替换为你的域名,需要和ssl证书对应的域名一致

重启服务

frpc客户端和frps服务端上分别重启对应服务

完成

在浏览器上输入https://www.example.com:8080 (注意这里替换成你的域名和端口) 即可访问esxi客户端,可以看到ssl证书也是正常的。

相关推荐
2501_915921431 天前
iOS App 电耗管理 通过系统电池记录、Xcode Instruments 与克魔(KeyMob)组合使用
android·ios·小程序·https·uni-app·iphone·webview
光影少年1 天前
http和https区别、令牌、三次握手流程
网络协议·http·https
2501_915921431 天前
iOS 描述文件制作过程,从 Bundle ID、证书、设备到描述文件生成后的验证
android·ios·小程序·https·uni-app·iphone·webview
“αβ”1 天前
传输层协议--TCP协议
linux·服务器·网络·网络协议·tcp/ip·http·https
小霸王_300378632 天前
《Google 与 Edge 浏览器对HTTP到HTTPS重定向处理的差异》
http·google·https·edge
蜂蜜黄油呀土豆2 天前
深入解析计算机网络中的应用层知识:HTTP 与 HTTPS
网络协议·计算机网络·http·https·ssl/tls
weixin_462446232 天前
Ubuntu 使用 systemd + Nginx 部署 code-server(含 HTTPS)
nginx·ubuntu·https
2501_915909062 天前
原生与 H5 共存情况下的测试思路,混合开发 App 的实际测试场景
android·ios·小程序·https·uni-app·iphone·webview
游戏开发爱好者82 天前
了解 Xcode 在 iOS 开发中的作用和功能有哪些
android·ios·小程序·https·uni-app·iphone·webview
xfan_me2 天前
SSL证书与HTTPS:为什么你的网站必须启用加密连接?
网络协议·https·ssl