2018-11-01 22:35:53 +00:00
|
|
|
#jinja2: lstrip_blocks: True
|
|
|
|
# {{ ansible_managed }}
|
|
|
|
upstream backend_pve {
|
|
|
|
server {{ pve_server_ip }}:{{ pve_server_port }};
|
|
|
|
}
|
|
|
|
|
|
|
|
server {
|
|
|
|
listen 80;
|
|
|
|
server_name {{ pve_server_name }};
|
|
|
|
|
|
|
|
{% if pve_nginx_tls_enabled %}
|
|
|
|
return 301 https://$server_name$request_uri;
|
|
|
|
{% else %}
|
|
|
|
proxy_redirect off;
|
|
|
|
location / {
|
|
|
|
proxy_pass https://backend_pve;
|
|
|
|
|
|
|
|
proxy_http_version 1.1;
|
|
|
|
proxy_set_header Upgrade $http_upgrade;
|
|
|
|
proxy_set_header Connection "upgrade";
|
|
|
|
proxy_buffering off;
|
|
|
|
client_max_body_size 0;
|
|
|
|
proxy_connect_timeout 3600s;
|
|
|
|
proxy_read_timeout 3600s;
|
|
|
|
proxy_send_timeout 3600s;
|
|
|
|
send_timeout 3600s;
|
|
|
|
}
|
|
|
|
{% endif %}
|
|
|
|
}
|
|
|
|
|
|
|
|
{% if pve_nginx_tls_enabled %}
|
|
|
|
server {
|
|
|
|
listen 443 ssl;
|
|
|
|
server_name {{ pve_server_name }};
|
|
|
|
|
|
|
|
proxy_redirect off;
|
|
|
|
|
|
|
|
location / {
|
|
|
|
proxy_pass https://backend_pve;
|
|
|
|
|
|
|
|
proxy_http_version 1.1;
|
|
|
|
proxy_set_header Upgrade $http_upgrade;
|
|
|
|
proxy_set_header Connection "upgrade";
|
|
|
|
proxy_buffering off;
|
|
|
|
client_max_body_size 0;
|
|
|
|
proxy_connect_timeout 3600s;
|
|
|
|
proxy_read_timeout 3600s;
|
|
|
|
proxy_send_timeout 3600s;
|
|
|
|
send_timeout 3600s;
|
|
|
|
}
|
|
|
|
|
|
|
|
ssl_certificate /etc/pki/tls/certs/{{ pve_nginx_tls_cert_file }};
|
|
|
|
ssl_certificate_key /etc/pki/tls/private/{{ pve_nginx_tls_key_file }};
|
|
|
|
}
|
|
|
|
{% endif %}
|