Rancher 官方安装文档说明:
一、安装rancher/server(默认latest版本)
- 运行Rancher,容器名字为 rancher-server,允许任何地址的主机访问7080端口,映射到rancher自身的8080端口
$ docker run -d --restart=unless-stopped --name=rancher-server -p 7080:8080 rancher/server
## 二、安装Rancher并启用SSL(HTTPS头打开rancher管理页面)
官方文档:https://www.cnrancher.com/docs/rancher/v1.x/cn/installing/basic-ssl-config/
启动 Rancher Server
$ docker run -d --restart=unless-stopped --name=rancher-server -p 8080:8080 rancher/server:latest
Nginx 配置模版
upstream rancher {
server rancher-server:8080;
}
map $http_upgrade $connection_upgrade {
default Upgrade;
'' close;
}
server {
listen 443 ssl spdy;
server_name rancher.域名.ink;
ssl_certificate /root/cert/rancher.域名.ink.crt;
ssl_certificate_key /root/cert/rancher.域名.ink.key;
ssl_prefer_server_ciphers on;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
location / {
proxy_pass http://rancher;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-Port $server_port;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
proxy_read_timeout 900s;
}
}