Cloud Front CDN with Meteor

Hey Guys!!
We are trying to enable CDN(CloudFront) on our Meteor app hosted in galaxy.
we tried to keep

WebAppInternals.setBundledJsCssUrlRewriteHook((url) => {

in main.js in Meteor server startup.
Everything is working when we directly hit the distribution url.
But problem comes when we hit our domain url. When I look at the page that got loaded there is our JS bundle script tag. When I copy that src url and test it in postman I get back our main index.HTML page with mime type as text/html rather than application/js.
But the one HTML that got returned with the above src url has also script tag with src url which points to right JS bundle file.

Can someone help what could be the reason for this ?