Table of Contents
Last updated: 12/12/2025

Supporting internal and external server access

ShareAspace can be deployed behind a gateway so that one ShareAspace installation might have several external domains.

Configure ReverseProxy to replace URLs in HTTP JSON response bodies

In multi-zone deployments - where ShareAspace is accessed via both internal and external domain - it's often necessary to rewrite URLS in HTTP response bodies. Following configuration example shows how to configure the ReverseProxy to replace URLs in responses:

{
    "Logging": {
        "LogLevel": {
            "Default": "Information",
            "Microsoft": "Warning",
            "Microsoft.Hosting.Lifetime": "Information",
            "Eurostep": "Information"
        }
    },
    "AllowedHosts": "*",
    "Kestrel": {
        "Endpoints": {
            "https": {
                "Url": "https://localhost:6001"
            }
        }
    },
    "ReverseProxy": {
        "Routes": {
            "ExternalExtensionRoute": {
                "ClusterId": "ShareAspaceCluster",
                "Match": {
                    "Path": "/space/{space-id}/externalExtension/validate/{extension-id}",
                    "Hosts": [
                        "external.domain"
                    ]
                },
                "Order": 0,
                "Transforms": [
                    {
                        "PathRemovePrefix": "/api"
                    },
                    {
                        "RequestHeadersCopy": "true"
                    },
                    {
                        "RequestHeaderOriginalHost": "true"
                    },
                    {
                        "SAs-Route": "true"
                    },
                    {
                        "ResponseBodyReplaceDomainWithHost": "internal.domain"
                    }
                ]
            },
            "ShareAspaceRoute": {
                "ClusterId": "ShareAspaceCluster",
                "Match": {
                    "Path": "{**catch-all}"
                },
                "Order": 1,
                "Transforms": [
                    {
                        "PathRemovePrefix": "/api"
                    },
                    {
                        "RequestHeadersCopy": "true"
                    },
                    {
                        "RequestHeaderOriginalHost": "true"
                    },
                    {
                        "SAs-Route": "true"
                    }
                ]
            }
        },
        "Clusters": {
            "ShareAspaceCluster": {
                "LoadBalancingPolicy": "FirstAlphabetical",
                "HttpClient": {
                    "DangerousAcceptAnyServerCertificate": true
                },
                "HealthCheck": "false",
                "Metadata": {
                    "ConsecutiveFailuresHealthPolicy.Threshold": "3"
                },
                "Destinations": {
                    "ShareAspaceCluster/destination1": {
                        "Address": "https://internal.domain:5001"
                    }
                }
            }
        }
    }
}

ResponseBodyReplaceDomainWithHost transform

The ReverseProxy will replace all occurrences of a specified host name with host name in the incoming request's host name header.