server {
    listen 80;
    listen [::]:80;
    server_name __MTA_STS_HOST__;
    return 301 https://__MTA_STS_HOST__$request_uri;
}

server {
    listen 443 ssl;
    listen [::]:443 ssl;
    http2 on;
    server_name __MTA_STS_HOST__;

    ssl_certificate __TLS_CERT__;
    ssl_certificate_key __TLS_KEY__;
    ssl_protocols TLSv1.2 TLSv1.3;
    ssl_prefer_server_ciphers on;
    add_header Strict-Transport-Security "max-age=31536000" always;
    add_header X-Content-Type-Options "nosniff" always;
    add_header X-Frame-Options "DENY" always;
    add_header Referrer-Policy "no-referrer" always;
    add_header Content-Security-Policy "default-src 'none'; frame-ancestors 'none'" always;

    location = /.well-known/mta-sts.txt {
        default_type text/plain;
        alias /var/lib/limristem-mail/mta-sts/mta-sts.txt;
    }
}
