I’ve created this config file /home/admin/conf/web/DOMAIN/nginx.conf_loginlock and it works.
Maybe it’s not the most optimal solution, but it does the job for now.
Your second approach is the recommended solution. You should never modify the domain.com.conf file directly, as it will get overwritten when rebuilding the domain. It is stated right on top of the file.
DO NOT MODIFY THIS FILE! CHANGES WILL BE LOST WHEN REBUILDING DOMAINS
Also, the reason why your first approach did not work is because the domain needed to be rebuilt in order for the changes to take effect, BUT back to my point above, your changes would have gotten removed anyways.