diff --git a/src/bundles/Elsa.Server.LoadBalancer/Elsa.Server.LoadBalancer.csproj b/src/bundles/Elsa.Server.LoadBalancer/Elsa.Server.LoadBalancer.csproj new file mode 100644 index 000000000..138ee315f --- /dev/null +++ b/src/bundles/Elsa.Server.LoadBalancer/Elsa.Server.LoadBalancer.csproj @@ -0,0 +1,13 @@ + + + + net8.0 + enable + enable + + + + + + + diff --git a/src/bundles/Elsa.Server.LoadBalancer/FodyWeavers.xml b/src/bundles/Elsa.Server.LoadBalancer/FodyWeavers.xml new file mode 100644 index 000000000..06ee72161 --- /dev/null +++ b/src/bundles/Elsa.Server.LoadBalancer/FodyWeavers.xml @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/bundles/Elsa.Server.LoadBalancer/Program.cs b/src/bundles/Elsa.Server.LoadBalancer/Program.cs new file mode 100644 index 000000000..1a98c9fb1 --- /dev/null +++ b/src/bundles/Elsa.Server.LoadBalancer/Program.cs @@ -0,0 +1,5 @@ +var builder = WebApplication.CreateBuilder(args); +builder.Services.AddReverseProxy().LoadFromConfig(builder.Configuration.GetSection("ReverseProxy")); +var app = builder.Build(); +app.MapReverseProxy(); +app.Run(); \ No newline at end of file diff --git a/src/bundles/Elsa.Server.LoadBalancer/Properties/launchSettings.json b/src/bundles/Elsa.Server.LoadBalancer/Properties/launchSettings.json new file mode 100644 index 000000000..241626351 --- /dev/null +++ b/src/bundles/Elsa.Server.LoadBalancer/Properties/launchSettings.json @@ -0,0 +1,38 @@ +{ + "$schema": "http://json.schemastore.org/launchsettings.json", + "iisSettings": { + "windowsAuthentication": false, + "anonymousAuthentication": true, + "iisExpress": { + "applicationUrl": "http://localhost:28212", + "sslPort": 44310 + } + }, + "profiles": { + "http": { + "commandName": "Project", + "dotnetRunMessages": true, + "launchBrowser": true, + "applicationUrl": "http://localhost:5272", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + }, + "https": { + "commandName": "Project", + "dotnetRunMessages": true, + "launchBrowser": true, + "applicationUrl": "https://localhost:7036;http://localhost:5272", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + }, + "IIS Express": { + "commandName": "IISExpress", + "launchBrowser": true, + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + } + } +} diff --git a/src/bundles/Elsa.Server.LoadBalancer/appsettings.Development.json b/src/bundles/Elsa.Server.LoadBalancer/appsettings.Development.json new file mode 100644 index 000000000..0c208ae91 --- /dev/null +++ b/src/bundles/Elsa.Server.LoadBalancer/appsettings.Development.json @@ -0,0 +1,8 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft.AspNetCore": "Warning" + } + } +} diff --git a/src/bundles/Elsa.Server.LoadBalancer/appsettings.json b/src/bundles/Elsa.Server.LoadBalancer/appsettings.json new file mode 100644 index 000000000..6ce85ebce --- /dev/null +++ b/src/bundles/Elsa.Server.LoadBalancer/appsettings.json @@ -0,0 +1,29 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft.AspNetCore": "Warning" + } + }, + "AllowedHosts": "*", + "ReverseProxy": { + "Routes": { + "route1": { + "ClusterId": "cluster1", + "Match": { + "Path": "{**catch-all}" + } + } + }, + "Clusters": { + "cluster1": { + "LoadBalancingPolicy": "RoundRobin", + "Destinations": { + "cluster1/destination1": { + "Address": "https://localhost:5001/" + } + } + } + } + } +}