Skip to content

Instantly share code, notes, and snippets.

@amanjuman
Last active October 22, 2021 19:49
Show Gist options
  • Select an option

  • Save amanjuman/c8f61f0927d822955afc9c0b6768a4e0 to your computer and use it in GitHub Desktop.

Select an option

Save amanjuman/c8f61f0927d822955afc9c0b6768a4e0 to your computer and use it in GitHub Desktop.
Nginx MTA STS Configuration
# This
location ^~ /.well-known/mta-sts.txt {
try_files $uri @mta-sts;
}
# Or This
location @mta-sts {
# add_header Content-Type "text/plain";
return 200 "version: STSv1\nmode: enforce\nmx: mailserver.example.com\nmax_age: 1036800\n";
}
# MTS-STS Directory
location = /.well-known/mta-sts.txt {
auth_basic off;
allow all;
default_type text/plain;
try_files $uri =404;
break;
}
location = /.well-known/mta-sts.txt {
default_type text/plain;
return 200 "version: STSv1\r\nmode: enforce\r\nmx: *.naut.ca\r\nmax_age: 604800\r\n";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment