I followed the official documentation to create a hairpin NAT and created a hairpin NAT rule.
If setup according to the example, the destination NAT rule will be applied when the destination port matches the port stated in the NAT rule. Including the traffics which are suppose to go out to the internet.
Some people seems to be using a workaround, by setting the destination address of the same NAT rule to the WAN IP address.
This causes a problem. If the WAN IP address is obtained from a DHCP server, the rule will be broken after an IP address change.