# Using a remote host as a local\_server.backend

**URL:** <https://community.fastly.com/t/using-a-remote-host-as-a-local-server-backend/447>\
**Category:** Compute\
**Tags:** edge\
**Created:** [September 24, 2023, 6:56pm UTC](https://community.fastly.com/t/using-a-remote-host-as-a-local-server-backend/447 "2023-09-24T18:56:06Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![crajcan](https://sea1.discourse-cdn.com/flex019/user_avatar/community.fastly.com/crajcan/32/253_2.png) [@crajcan](https://community.fastly.com/u/crajcan)\
**Post date:** [September 24, 2023, 6:56pm UTC](https://community.fastly.com/t/using-a-remote-host-as-a-local-server-backend/447/1 "2023-09-24T18:56:06Z")

</div>

I have a backend configured that I am using in production. I would like to use the same backend in my local development environment.

I have configured the backend as follows:

```auto
[local_server]
[local_server.backends]
[local_server.backends.<my backend>]
url = "<my backend's api url>"

```

And when I start the local service with `fastly compute serve`, it seems to connect to the backend:

```auto
✓ Running local server

INFO: Listening on http://127.0.0.1:7676

INFO: Command output:
--------------------------------------------------------------------------------
2023-09-24T18:53:32.945566Z INFO checking if backend '<my backend>' is up
2023-09-24T18:53:33.250933Z INFO backend '<my backend>' is up
2023-09-24T18:53:33.251065Z INFO Listening on http://127.0.0.1:7676

```

The actual request my local service makes looks fine, except that the request body is omitted. I’m wondering if I need to do something special with the local server to configure TLS in order to get the request body to send?

---

<div class="post-metadata">

**Author:** ![Integralist](https://sea1.discourse-cdn.com/flex019/user_avatar/community.fastly.com/integralist/32/88_2.png) [@Integralist](https://community.fastly.com/u/Integralist)\
**Post date:** [September 25, 2023, 10:03am UTC](https://community.fastly.com/t/using-a-remote-host-as-a-local-server-backend/447/2 "2023-09-25T10:03:12Z")

</div>

Hi @crajcan

All looks fine as far as what you’ve explained so far.

I think we’d need to see your code to ascertain any issues.

You can either email an example from your code to [support@fastly.com](mailto:support@fastly.com) or alternatively please use [Fiddle - Fastly](https://fiddle.fastly.dev/new) to create a reduced test case.

Many thanks!

---

<div class="post-metadata">

**Author:** ![crajcan](https://sea1.discourse-cdn.com/flex019/user_avatar/community.fastly.com/crajcan/32/253_2.png) [@crajcan](https://community.fastly.com/u/crajcan)\
**Post date:** [September 25, 2023, 5:17pm UTC](https://community.fastly.com/t/using-a-remote-host-as-a-local-server-backend/447/3 "2023-09-25T17:17:34Z")

</div>

Hey @Integralist, thanks for pointing me to the Fastly Fiddle.

When I put in my origin server it rejected my url as invalid which made me realize my local config had the url set as:

```auto
[local_server.backends.<my_backend>]
url = "https://<my_domain>.com:443/<my_endpoint_path_prefix>"

```

Once I remove the endpoint path prefix it works fine. Still not sure why that broke things. If I get the time I’ll email some code over

---

<div class="post-metadata">

**Author:** ![Integralist](https://sea1.discourse-cdn.com/flex019/user_avatar/community.fastly.com/integralist/32/88_2.png) [@Integralist](https://community.fastly.com/u/Integralist)\
**Post date:** [September 26, 2023, 8:25am UTC](https://community.fastly.com/t/using-a-remote-host-as-a-local-server-backend/447/4 "2023-09-26T08:25:45Z")

</div>

Hi @crajcan

Thanks for the update!

Yes, what you had defined would have caused an error.

The `url` field is a little misleading because it’s supposed to be a scheme/hostname combination but not the ‘path’ segment, as the request’s path is appended to the backend url.

Something for us to clarify in our documentation:

> **[fastly.toml package manifest format | Fastly Developer Hub](https://developer.fastly.com/reference/compute/fastly-toml/#local-server)**
>
> Everything you need to build on Fastly

**UPDATE:**  
I stand corrected! I just re-read our documentation and noticed it _does_ say a path prefix is allowed, so yes please @crajcan if you could send [support@fastly.com](mailto:support@fastly.com) your code and a link to this forum thread that would be greatly appreciated.

---

<div class="post-metadata">

**Author:** ![Integralist](https://sea1.discourse-cdn.com/flex019/user_avatar/community.fastly.com/integralist/32/88_2.png) [@Integralist](https://community.fastly.com/u/Integralist)\
**Post date:** [September 26, 2023, 9:32am UTC](https://community.fastly.com/t/using-a-remote-host-as-a-local-server-backend/447/5 "2023-09-26T09:32:09Z")

</div>

👋

I’ve successfully tested the use of a path-prefix (see screenshot below), so I would recommend emailing [support@fastly.com](mailto:support@fastly.com) as they’ll be able to take a look at your source code and check your configuration to see if there’s anything mis-configured that would cause this to not work.

 ![Screenshot 2023-09-26 at 10.30.05](https://us1.discourse-cdn.com/flex019/uploads/fastly1/original/1X/fb8ce81e063d33a119db08cd17fa44afd211d854.jpeg)
