Compute@Edge fetch path without host from backend
Hi,
I have defined my backends in fastly.toml as:
[local_server]
[local_server.backends]
[local_server.backends.my-backend]
url = "https://my-backend.app"
Now, I would like to fetch from the site without having to repeat the host:
fetch("/path/", { backend: 'my-backend' })
When I try this locally, I am getting empty string without any failure.
fetch("https://my-backend.app/path/", { backend: 'my-backend' })
This works correctly, however it duplicates the backend already stated in fastly.toml. What I need is to separate the configurations from the script - this unfortunately disallows me that.
Basically I would like to achieve something like this:
fetch(backends.my-backend.host + "/path/", { backend: 'my-backend' })
-
Hi Vojtech,
Thank you for reaching out! To better assist please reach out via support@fastly.com and we'll be more than happy to troubleshoot this further.
Please sign in to leave a comment.
Comments
2 comments