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
A record from map.domain.com to IP
Origin rule: if hostname equals map.domain.com -> rewrite destination port to 8001
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.
6 Replies
zegevlier
zegevlier•2y ago
Is the record proxied?
Fused
FusedOP•2y ago
No, should I enable proxy?
zegevlier
zegevlier•2y ago
Origin rules have no effect if the record is not proxied. If you need to origin rule to work, you will have to proxy the record.
Fused
FusedOP•2y ago
I enabled the proxy and I'm getting sent to a different page from my nginx config 🤔 I'm not listening to this subdomain with nginx though
zegevlier
zegevlier•2y ago
The DNS record is probably still cached. You can check if the request is going through CF by looking in the devtools and seeing if you have any cf-[something] headers in the response
Fused
FusedOP•2y ago
Thanks!

Did you find this page helpful?