Custom template, Error: Let's Encrypt validation status 400

I made my own template to support custom headers and rewrite rules like explained here: [Feature] Custom headers and rewrite rules · Issue #3571 · hestiacp/hestiacp · GitHub . Every few months i get the issue foreach domain:
Error: Let’s Encrypt validation status … Invalid response from XXX/.well-known/acme-challenge/d-cAkGEVF-XXXXXXXXxvmXLDlXU: 404"

I usually have fixed it by changing to default template, disable ssl, enable ssl, swith back to my custom template.
How could i adjust the template to make the Lets Encrypt validation work with my changes ?

Make sure that the template has the following line:

include %home%/%user%/conf/web/%domain%/nginx.conf_*;

and for .stpl

include %home%/%user%/conf/web/%domain%/nginx.ssl.conf_*;

Thanks for response,
i have used the default template as base and only added those 2 lines to my custom template like written on github:

include %home%/%user%/conf/web/%domain%/nginx.additionalheaders.conf*;
include %home%/%user%/conf/web/%domain%/additional.rules*;

Edit: I just checked it,

include %home%/%user%/conf/web/%domain%/nginx.conf_*;

is present.