12
Allow to proxy an external URL
complete
O
Olivier Livet
It would be so cool if it was possible to proxy an external URL.
Case of use :
- backend api for example
- external image transformation service
On Vercel or Netlify, it's possible to make this kind of configuration :
{
"src": "/api/(.*)",
"dest": "https://api.secret-domain.tld/api/$1"
},
Activity Feed
Sort by
Patrick Sullivan
complete
Patrick Sullivan
Hello - we're happy to share that this has been completed, and is documented here https://support.gatsbyjs.com/hc/en-us/articles/1500003051241-Working-with-Redirects-and-Rewrites.
Of note: "/api" cannot be overwritten since that path is reserved to support functions
Please let us know if the corresponding documentation is at all unclear. Thank you!
S
Shruti Chaturvedula
in progress
Ben Robertson
Merged in a post:
Hosting: Support proxying a path to a different domain
Ben Robertson
A few customers have asked if we can support domain proxying in Gatsby Hosting
Use cases for this:
- Serve images / files from a CMS (like Drupal) but make it look like they are coming from the root domain
- pass API requests to a different domain, ie requests to example.com/api get routed to api.example.com
J
Joel Smith
under review
Our team is looking at this now and should have a solution shortly!