My toddler makes me angry

I normally don’t show my anger or show any reaction at all. The reason he makes me angry is when he gets angry out of nowhere and starts hitting me and smacking my head. Even at night or middle of the night he has night terrors and starts hitting me. In the morning or when he’s tired he physically hurts me. I just let him be him and act out how he wants especially if we’re alone. Should I continue to ignore his anger or acknowledge it? I know parents that react back or yell at their kids but I feel bad doing that to him since he just turned 2 and doesn’t understand plus he is a delayed talker.