2019-08-22 15:29:31 +02:00
|
|
|
map $http_upgrade $connection_upgrade {
|
|
|
|
default upgrade;
|
|
|
|
'' close;
|
|
|
|
}
|
|
|
|
|
2019-08-22 14:48:39 +02:00
|
|
|
server {
|
2019-08-22 15:29:31 +02:00
|
|
|
listen 80;
|
|
|
|
listen [::]:80;
|
2019-08-22 14:48:39 +02:00
|
|
|
|
2019-08-22 15:29:31 +02:00
|
|
|
server_name unms.{{ http_domain_external }} unms.{{ http_domain_internal }};
|
2019-08-22 14:48:39 +02:00
|
|
|
|
2019-08-22 15:29:31 +02:00
|
|
|
location / {
|
|
|
|
return 301 https://$host$request_uri;
|
|
|
|
}
|
2019-08-22 14:48:39 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
server {
|
2019-08-22 15:29:31 +02:00
|
|
|
listen 443 ssl http2;
|
|
|
|
listen [::]:443 ssl http2;
|
|
|
|
server_name unms.{{ http_domain_external }} unms.{{ http_domain_internal }};
|
2019-08-22 14:48:39 +02:00
|
|
|
|
|
|
|
charset utf-8;
|
|
|
|
server_tokens off;
|
|
|
|
proxy_ssl_verify off;
|
|
|
|
|
|
|
|
ssl_certificate /etc/nginx/ssl/{{ inventory_hostname_short }}.{{ http_domain_external }}/fullchain.pem;
|
|
|
|
ssl_certificate_key /etc/nginx/ssl/{{ inventory_hostname_short }}.{{ http_domain_external }}/privkey.pem;
|
|
|
|
|
|
|
|
include /etc/nginx/snippets/letsencrypt-acme-challenge.conf;
|
|
|
|
|
2019-08-22 15:29:31 +02:00
|
|
|
set $upstream 127.0.0.1:9443; # The UNMS Controller Port
|
2019-08-22 14:48:39 +02:00
|
|
|
|
|
|
|
location / {
|
2019-08-22 15:29:31 +02:00
|
|
|
proxy_pass https://$upstream;
|
|
|
|
proxy_redirect https://$upstream https://$server_name;
|
2019-08-22 14:48:39 +02:00
|
|
|
|
2019-08-22 15:29:31 +02:00
|
|
|
proxy_cache off;
|
|
|
|
proxy_store off;
|
|
|
|
proxy_buffering off;
|
|
|
|
proxy_http_version 1.1;
|
|
|
|
proxy_read_timeout 36000s;
|
2019-08-22 14:48:39 +02:00
|
|
|
|
2019-08-22 15:29:31 +02:00
|
|
|
proxy_set_header Host $http_host;
|
|
|
|
proxy_set_header Upgrade $http_upgrade;
|
|
|
|
proxy_set_header Connection $connection_upgrade;
|
|
|
|
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 Referer "";
|
|
|
|
|
|
|
|
client_max_body_size 0;
|
|
|
|
}
|
2019-08-22 14:48:39 +02:00
|
|
|
}
|