I got around the issue by putting this in nginx.conf for anyone with a similar issue:
server {
listen 80;
access_log /var/log/nginx/http.access.log main;
location ^~ /.well-known {
root /exports/$host;
autoindex off;
}
location / {
return 301 https://$host$request_uri;
}
}
But obviously this should not be necessary