2021-11-08 19:45:20 +00:00
|
|
|
map $http_upgrade $connection_upgrade {
|
|
|
|
default upgrade;
|
|
|
|
'' close;
|
|
|
|
}
|
|
|
|
|
2021-11-05 15:06:45 +00:00
|
|
|
server {
|
|
|
|
listen 443;
|
|
|
|
server_name rancher.{{ pillar['network']['domain'] }};
|
|
|
|
ssl_certificate /etc/rancher/ssl/rancher-server.crt;
|
|
|
|
ssl_certificate_key /etc/rancher/ssl/rancher-server.key;
|
|
|
|
location /{
|
2021-11-18 12:59:40 +00:00
|
|
|
proxy_pass https://172.18.0.1:9080;
|
2021-11-08 10:17:51 +00:00
|
|
|
proxy_http_version 1.1;
|
2021-11-18 12:59:40 +00:00
|
|
|
proxy_read_timeout 3600;
|
|
|
|
proxy_set_header X-API-request-url $scheme://$host:$server_port$request_uri;
|
2021-11-08 10:17:51 +00:00
|
|
|
proxy_set_header Upgrade $http_upgrade;
|
2021-11-08 19:45:20 +00:00
|
|
|
proxy_set_header Connection $connection_upgrade;
|
|
|
|
proxy_set_header Host $host;
|
|
|
|
proxy_set_header X-Real-IP $remote_addr;
|
|
|
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
|
|
proxy_set_header X-Forwarded-Proto $scheme;
|
|
|
|
proxy_set_header X-Forwarded-Port $server_port;
|
2021-11-18 12:59:40 +00:00
|
|
|
proxy_set_header X-Forwarded-Host $host:$server_port;
|
|
|
|
proxy_set_header Referer $host:$server_port;
|
|
|
|
proxy_buffering off;
|
|
|
|
proxy_redirect off;
|
2021-11-05 15:06:45 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
server {
|
|
|
|
listen 80;
|
|
|
|
server_name rancher.{{ pillar['network']['domain'] }};
|
|
|
|
return 301 https://rancher.{{ pillar['network']['domain'] }}$request_uri;
|
|
|
|
}
|