Nextcloud universal rewrite(redirection) causing letsencrypt error - virtualhost help

Using docker, official nextcloud image, and official certbot image on ubuntu 18.04 server
Problem - Nextcloud universally redirects(rewrites) everything to domain.com/login
This prevents letsencrypt/certbot from accessing /var/www/html/.well-known/acme-challenge (aka domain.com/.well-known/acme-challenge/). Certbot is unable to verify domain because of this.
After checking with letsencrypt community the solution is to add an “allow statement to the virtualhost config”

I can access the vhost file but i don’t know how to configure the vhost file to allow outside access to /var/www/html/.well-known/acme-challenge directory. Any help would be greatly appreciated.