DockerComposeAspireDashboardResourceBuilderExtensions.WithForwardedHeaders Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Configures whether forwarded headers processing is enabled for the Aspire dashboard container.
public static Aspire.Hosting.ApplicationModel.IResourceBuilder<Aspire.Hosting.Docker.DockerComposeAspireDashboardResource> WithForwardedHeaders(this Aspire.Hosting.ApplicationModel.IResourceBuilder<Aspire.Hosting.Docker.DockerComposeAspireDashboardResource> builder, bool enabled = true);
static member WithForwardedHeaders : Aspire.Hosting.ApplicationModel.IResourceBuilder<Aspire.Hosting.Docker.DockerComposeAspireDashboardResource> * bool -> Aspire.Hosting.ApplicationModel.IResourceBuilder<Aspire.Hosting.Docker.DockerComposeAspireDashboardResource>
<Extension()>
Public Function WithForwardedHeaders (builder As IResourceBuilder(Of DockerComposeAspireDashboardResource), Optional enabled As Boolean = true) As IResourceBuilder(Of DockerComposeAspireDashboardResource)
Parameters
The IResourceBuilder<T> instance.
- enabled
- Boolean
True to enable forwarded headers (ASPIRE_DASHBOARD_FORWARDEDHEADERS_ENABLED=true), false to disable it (sets the value to false).
Returns
The same IResourceBuilder<T> to allow chaining.
Remarks
This sets the ASPIRE_DASHBOARD_FORWARDEDHEADERS_ENABLED environment variable inside the dashboard container. When enabled, the dashboard will process X-Forwarded-Host and X-Forwarded-Proto headers which is required when the dashboard is accessed through a reverse proxy or load balancer.