I thought I should post an update here, now that the issue has been resolved. Maybe this will be useful for anyone searching for an answer to a similar problem.
The issue we had was:
- We were developing a new website, migrating to Netlify / Gatsby
- Our old website was still live at the original domain
- We assigned the domain to our account when setting it up, but had not switched the DNS to point to Netlify
- When trying to route the proxy to our currently live (old) website, Netlify first looks up the account to see what domains are mapped to it, bypassing the DNS
- This meant that in looking for example.org/api/myService, Netlify recognised example.org as a site that it served. It did not check the DNS and go to the currently live site. This meant that it searched for that route locally, serving up our new 404 page when that route was not found.
So to resolve this, I used a different URL to proxy through to our API service. Another resolution would be to have removed the domain from the account until we were ready to go live.