cloudflare的nginx负载均衡Cloudflare Workers 是一种无服务器脚本,可以用于实现负载均衡功能。以下是一个简单的配置思路:
创建Cloudflare Worker登录到 Cloudflare 仪表盘。导航到“Workers”部分,创建一个新的 Worker。
编写 Worker 脚本在 Worker 脚本中,你可以定义后端服务器列表,并实现负载均衡逻辑。以下是一个简单的示例,使用轮询算法:
12345678910111213141516171819const backendServers = [ 'https://server1.example.com', 'https://server2.example.com', 'https://server3.example.com'];let currentServerIndex = 0;addEventListener('fetch', event => { event.respondWith( ...
Welcome to Hexo! This is your very first post. Check documentation for more info. If you get any problems when using Hexo, you can find the answer in troubleshooting or you can ask me on GitHub.
Quick StartCreate a new post1$ hexo new "My New Post"
More info: Writing
Run server1$ hexo server
More info: Server
Generate static files1$ hexo generate
More info: Generating
Deploy to remote sites1$ hexo deploy
More info: Deployment
前言当我们入坑开始部署自己的站点后,根据使用用途的不同,可能会有多个web服务需要管理,而SSL时绝大多数web服务都需要使用的,那么如何管理SSL证书呢?有很多办法可以申请证书,单台服务器,当然很简单,在服务区上使用certbot或acme等申请证书,设置cron任务。到那时有多台服务器时,应该如何快捷地部署和管理证书呢?之前有用过一段时间的httpsok,但httpsok是SaaS服务,所有的证书都会自动共享给httpsok,先不说安全问题,作为有强大控制欲的我们,当然会希望这样的统一证书管理服务,可以直接由自己完全掌控。所以,直接在本机上运行certimate的docker容器,完成对自己所有的域名的证书申请,并自动部署到远程服务器上。
使用docker部署certimate我们使用docker compose来部署certimate,docker-compose.yml文件代码如下:
123456789services: certimate: image: registry.cn-shanghai.aliyuncs.com/usual2970/certimate:lat ...