Give precedence to the acme challenge.
If the acme challenge is in a location block but the default redirection is not, the default always takes precedence (Nginx won't resolve the order between the different directives, but it will between different location blocks).