Repository navigation
Server Configuration
Don Kackman edited this page Mar 17, 2024
·
4 revisions
DIG is built with ASP.NET Core and uses its configuration providers.
The dig.server component loads configuration settings in this order, with the each set of configuration values taking precedence over those already loaded:
-
appsettings.jsonin the folder with the executable. These are the default values. - From environment variables. DIG specific settings will be prefixed with
dig:. - From
appsettings.jsonin~/.dig. These are installation specific settings that might get set by an installer. - From
appsettings.user.jsonin~/.dig. These are the user specified settings and override everything but the command line. - A fully qualified path to a settings json file passed to
dig.serveron the command line.
Logging can be configured in any of the above settings locations.
A typical logging configuration section looks like:
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.AspNetCore": "Information",
"Microsoft.Hosting.Lifetime": "Information",
"Microsoft.EntityFrameworkCore": "Information",
"System.Net.Http": "Error",
"Polly": "Error"
},
"Console": {
"IncludeScopes": false,
"LogLevel": {
"Microsoft.EntityFrameworkCore": "Information",
"Default": "Information",
"Polly": "Error",
"System.Net.Http": "Error"
}
}
},
By default dig.server will use the built-in ASP.NET web server, Kestrel.
The default Kestrel configuration binds to port 41410 and does not use TLS.
"Kestrel": {
"Endpoints": {
"Http": {
"Url": "http://0.0.0.0:41410"
}
}
},
If you have TLS certificates you can configure Kestrel to use them following this letsencrypt example:
"https_port": 8787,
"Kestrel": {
"Endpoints": {
"HttpsInlineCertAndKeyFile": {
"Url": "https://0.0.0.0:8787",
"Certificate": {
"Path": "/etc/letsencrypt/live/<domain>/fullchain.pem",
"KeyPath": "/etc/letsencrypt/live/<domain>/privkey.pem"
}
}
}
}
It is also possible to host Kestrel behind a reverse proxy such as IIS, Apache, and Nginx.