Origin rule doesn't work

I have a site in a specific port of my VPS so I can access it doing IP:PORT. I'd like to create a subdomain that directs me there so I did:
A record from map.domain.com to IP
Origin rule: if hostname equals map.domain.com -> rewrite destination port to 8001

However when I enter map.domain.com I get sent to the main page and only map.domain.com:8001 sends me to the right page. It looks like the origin rule to change the port isn't working.
Was this page helpful?