-
Notifications
You must be signed in to change notification settings - Fork 3
110. [Ingress] How to configure statically (via config files)
Konstantin Lepeshenkov edited this page May 15, 2024
·
5 revisions
to your appsettings.json
(or host.json
, if it is Azure Functions):
{
...
"ThrottlingTrollIngress": {
"Rules": [
... here go rate limiting rules and limits...
],
"WhiteList": [
... here go whitelisted URIs...
]
}
...
}
NOTE: in Azure Functions you will also need to explicitly load configuration values from host.json
file with a code like this:
builder.ConfigureAppConfiguration(configBuilder => {
configBuilder.AddJsonFile("host.json", optional: false, reloadOnChange: true);
});
The ThrottlingTrollIngress
config section is represented by ThrottlingTrollConfig class, you can use all properties of that class in your configuration.
// Either like this:
app.UseThrottlingTroll();
// Or like this:
app.UseThrottlingTroll(options =>
{
// Configure other parameters here
});