Files
geerlingguy-ansible-for-devops/https-nginx-proxy/provisioning/templates/https.test.conf.j2
T
2019-08-16 11:05:01 -05:00

26 lines
739 B
Django/Jinja

# HTTPS Test server configuration.
# Redirect HTTP traffic to HTTPS.
server {
listen 80 default_server;
server_name _;
index index.html;
return 301 https://$host$request_uri;
}
# Proxy HTTPS traffic using the self-signed certificate created by Ansible.
server {
listen 443 ssl default_server;
server_name {{ server_hostname }};
location / {
include /etc/nginx/proxy_params;
proxy_pass http://localhost:8080;
proxy_read_timeout 90s;
proxy_redirect http://localhost:8080 {{ server_hostname }};
}
ssl_certificate {{ certificate_dir }}/{{ server_hostname }}/fullchain.pem;
ssl_certificate_key {{ certificate_dir }}/{{ server_hostname }}/privkey.pem;
}