Hairpin Nat hotspot?

good morning everyone, I made a hotspot with mikrotik captive portal that when it was in http worked perfectly. now I switched to https, almost everything works, after I log in however I no longer have access to pages such as https://domani/status.html


I note that in ip dns a static query is inserted with regexp: domain ip:10.5.50.1 which would be the hotspot gateway

after logging in, if I resolve the domain I don’t have 10.5.50.1 but the public IP. so I think I have to do a hairpin style dstnat of the traffic with source 10.5.50.0/24
Is something like this correct in your opinion?

/ip firewall nat 
add chain=dstnat src-address=10.5.50.0/24 dst-address-list=ip-domain action=dst-nat to-address=10.5.50.1
add chain=srcnat src-address=10.5.50.0/24 dst-address=10.5.50.1 action=masquerade

I would like to point out that if after logging in I type https://10.5.50.1/status.html the page appears correctly with a certificate error

It seems that the rules above are not doing their job. is there anything else?