Try to use the IIS rewrite module.
Similar issues for your references:
How to allow authenticated cross-domain calls in an SP 2016 on-prem scenario?
CORS Change in SharePoint Server 2016
Other reference:
Fixing issue in making cross domain Ajax call to SharePoint REST service in Chrome
If the response is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.