Skip to content

Instantly share code, notes, and snippets.

@JeepNL
Created May 3, 2021 10:03
Show Gist options
  • Save JeepNL/984ff44af2b897d2b6d101fdf6256371 to your computer and use it in GitHub Desktop.
Save JeepNL/984ff44af2b897d2b6d101fdf6256371 to your computer and use it in GitHub Desktop.
YARP appsettings.Development.json
{
//
// Logging
//
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft": "Information",
"Yarp": "Information",
"Microsoft.Hosting.Lifetime": "Information"
}
},
//
// General
//
//"AllowedHosts": "production.localhost;beta.localhost",
"AllowedHosts": "*",
//
// Kestrel
//
"Kestrel": {
"Endpoints": {
//"Http": {
// "Url": "http://[::]:10080",
// "Protocols": "Http1AndHttp2"
//},
"HttpsSni": {
"Url": "https://[::]:10443",
"Sni": {
"production.localhost": {
"Protocols": "Http1AndHttp2",
"ClientCertificateMode": "NoCertificate", // #TODO What's this?
"SslProtocols": [ "Tls11", "Tls12", "Tls13" ],
"Certificate": {
"Path": "cert.pfx",
"Password": "<password>"
}
},
"beta.localhost": {
"Protocols": "Http1AndHttp2",
"ClientCertificateMode": "NoCertificate", // #TODO What's this?
"SslProtocols": [ "Tls11", "Tls12", "Tls13" ],
"Certificate": {
"Path": "cert.pfx",
"Password": "<password>"
}
}
}
}
}
},
//
// YARP
//
"ReverseProxy": {
"Routes": {
"localhostProductionRoute": {
"ClusterId": "localhostProductionCluster",
"Match": {
"Hosts": [ "production.localhost" ]
}
},
"localhostBetaRoute": {
"ClusterId": "localhostBetaCluster",
"Match": {
"Hosts": [ "beta.localhost" ]
}
}
},
"Clusters": {
"localhostProductionCluster": {
"Destinations": {
"production.localhost": {
"Address": "https://production.localhost:5001" // localhost main site
}
}
},
"localhostBetaCluster": {
"Destinations": {
"beta.localhost": {
"Address": "https://beta.localhost:5002" // localhost beta site
}
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment