http {
  server {
    listen 80;
    listen [::]:80;
    server_name "{{ ansible_host }} www.{{ ansible_host }}";
    return 301 https://$host$request_uri;
  }

  server {
    listen 443 ssl http2;
    listen [::]:443 ssl http2;
    server_name "{{ ansible_host }} www.{{ ansible_host }}";
    location ~ /.well-known/ {
        allow all;
        root /var/www/html;
    }
    ssl_certificate "/etc/letsencrypt/live/{{ ansible_host }}/fullchain.pem";
    ssl_certificate_key "/etc/letsencrypt/live/{{ ansible_host }}/privkey.pem";
    location / {
        proxy_pass "http://docksible_app:{{ internal_http_port }}";
        proxy_set_header Host      $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-Proto $scheme;
    }
    location = /xmlrpc.php {
        deny all;
        access_log off;
    }
  }
}
