Skip to content
John Dean edited this page Feb 10, 2019 · 1 revision

Rancher

Creating the SSL proxy:

docker run -d -p80:80 -p443:443  -v /root/nginx/conf/default.conf:/etc/nginx/conf.d/default.conf:ro -v /root/nginx/certs:/etc/nginx/certs --link=rancher-server --name nginx-rancher-ssl nginx

/root/nginx/conf/default.conf

upstream rancher {
    server rancher-server:8080;
}

map $http_upgrade $connection_upgrade {
    default Upgrade;
    ''      close;
}

server {
    listen 443 ssl http2;
    server_name rancher2.soapbubble.online;
    ssl_certificate /etc/nginx/certs/soapbubble.online.cert;
    ssl_certificate_key /etc/nginx/certs/soapbubble.online.key;

    location / {
        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_pass http://rancher;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection $connection_upgrade;
        # This allows the ability for the execute shell window to remain open for up to 15 minutes. Without this parameter, the default is 1 minute and will automatically close.
        proxy_read_timeout 900s;
    }
}

server {
    listen 80;
    server_name rancher2.soapbubble.online;
    return 301 https://$server_name$request_uri;
}

Sections

Clone this wiki locally