# Reverse Proxy set up

**URL:** <https://forum.umbraco.com/t/reverse-proxy-set-up/4588>\
**Category:** Questions\
**Tags:** v13\
**Created:** [July 15, 2025, 12:11pm UTC](https://forum.umbraco.com/t/reverse-proxy-set-up/4588 "2025-07-15T12:11:35Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![BrandonJayM](https://forum.umbraco.com/user_avatar/forum.umbraco.com/brandonjaym/32/2811_2.png) [@BrandonJayM](https://forum.umbraco.com/u/BrandonJayM)\
**Post date:** [July 15, 2025, 12:11pm UTC](https://forum.umbraco.com/t/reverse-proxy-set-up/4588/1 "2025-07-15T12:11:35Z")

</div>

Hello,

So I am trying to set up an umbraco 13 site in .net 8 with a reverse proxy. E.g [mysite-frontend.com/path-test](http://mysite-frontend.com/path-test) points to [mybackendwebsite.com](http://mybackendwebsite.com) throught cloudflare.

I have set this up in my program.cs:

if (\_config[“Proxy:SiteUrl”].Contains(“/path-test”))  
{  
app.Use((ctx, next) =\>  
{  
var url = \_config[“Proxy:CanonicalUrl”];  
var canonical = url.StartsWith(“https://”)  
? url.Substring(“https://”.Length)  
: url;

```
    ctx.Request.Host = new HostString(canonical);
    ctx.Request.Scheme = "https";
    ctx.Request.PathBase = "/path-test";
    return next();
});
app.UsePathBase("/path-test");

```

}

However, this uses path-test twice. in all umbraco calls. If I remove ‘ctx.Request.PathBase = “/path-test”;’ then the calls work but no css loads on the front end. If I remove ‘app.UsePathBase(“/path-test”);’ then I cannot access umbraco but the front end works.

I have tried using this but it doesn’t seem to work with a path inside of it:

```auto
"Umbraco": {
  "CMS": {
    "WebRouting": {
      "UmbracoApplicationUrl": "http://www.mysite.com/"
    }
  }
}

```

Just wondering if anyone had any similar issues using a proxy. Any help would be very appreicated.

---

<div class="post-metadata">

**Author:** ![Emetico](https://forum.umbraco.com/user_avatar/forum.umbraco.com/emetico/32/2807_2.png) [@Emetico](https://forum.umbraco.com/u/Emetico)\
**Post date:** [July 15, 2025, 1:40pm UTC](https://forum.umbraco.com/t/reverse-proxy-set-up/4588/2 "2025-07-15T13:40:17Z")

</div>

Hi Brandon,

With a reverse proxy I think you need to use forward headers.

```auto
builder.Services.Configure<ForwardedHeadersOptions>(options =>
{
    options.ForwardedHeaders = ForwardedHeaders.XForwardedProto | ForwardedHeaders.XForwardedFor | ForwardedHeaders.XForwardedHost;
});

 app.UseForwardedHeaders();

```

---

<div class="post-metadata">

**Author:** ![BrandonJayM](https://forum.umbraco.com/user_avatar/forum.umbraco.com/brandonjaym/32/2811_2.png) [@BrandonJayM](https://forum.umbraco.com/u/BrandonJayM)\
**Post date:** [July 15, 2025, 2:00pm UTC](https://forum.umbraco.com/t/reverse-proxy-set-up/4588/3 "2025-07-15T14:00:48Z")

</div>

Hi Bo,

Thanks for this. I didn’t actually post my full configuration service but I have already added this and it still doesn’t work. Do you think the code I am using above could be interfering with it? Is their anything else you would know that would be needed to set up a proxy url

---

<div class="post-metadata">

**Author:** ![pjohann-ko](https://forum.umbraco.com/user_avatar/forum.umbraco.com/pjohann-ko/32/4749_2.png) [@pjohann-ko](https://forum.umbraco.com/u/pjohann-ko)\
**Post date:** [February 4, 2026, 3:44pm UTC](https://forum.umbraco.com/t/reverse-proxy-set-up/4588/4 "2026-02-04T15:44:52Z")

</div>

Hi,

even though the question is a bit older and you’ve probably already solved the problem for yourself, I wanted to share my solution for other people.

I currently had the same problem and the simple forward headers configuration didn’t worked. But the warning message “Unknown Proxy” in the logs helped. Apparently, the middleware does nothing if it doesn’t know the proxy.

The solution was to add the proxy to the list of known proxies, and then it worked.

```csharp
services.Configure<ForwardedHeadersOptions>(options =>
{
    options.ForwardedHeaders =
        ForwardedHeaders.XForwardedFor |
        ForwardedHeaders.XForwardedHost |
        ForwardedHeaders.XForwardedProto;

    options.KnownProxies.Add(IPAddress.Parse("127.0.0.1"));
});

```
