# 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; } # Serve HTTPS traffic using the self-signed certificate created by Ansible. server { listen 443 ssl default_server; server_name {{ server_hostname }}; root {{ nginx_docroot }}; ssl_certificate {{ certificate_dir }}/{{ server_hostname }}/fullchain.pem; ssl_certificate_key {{ certificate_dir }}/{{ server_hostname }}/privkey.pem; }