Add the snippet to an existing server block
Nginx does not use .htaccess. Put hostname rules at server level inside the existing server block for the source hostname, not inside a location. Page snippets are exact-match location blocks and also belong inside server. Keep your server_name, listen directives, certificates, and existing application settings. Do not duplicate an existing exact-match location; merge its behavior deliberately.