Skip to main content

Service Configuration

Overview

HTTP server configuration is primarily used to control HTTP server hosts, ports, certificates, etc.

Configuration Description

golang Structure Definition:

RestConf struct {
service.ServiceConf
Host string `json:",default=0.0.0.0"`
Port int
CertFile string `json:",optional"`
KeyFile string `json:",optional"`
Verbose bool `json:",optional"`
MaxConns int `json:",default=10000"`
MaxBytes int64 `json:",default=1048576"`
// milliseconds
Timeout int64 `json:",default=3000"`
CpuThreshold int64 `json:",default=900,range=[0:1000]"`
Signature SignatureConf `json:",optional"`
Middlewares MiddlewaresConf
}

HTTP server primary configuration entry is set out below table:

NameDataTypeMeaningDefault valueRequired?
HoststringListening address0.0.0.0YES
PortintListening PortNoneYES
CertFilestringhttps Certificate FileNoneNO
KeyFilestringhttps Certificate FileNoneNO
VerboseboolPrint detailed logsNoneNO
MaxConnsintNumber of concurrent requests10000YES
MaxBytesInt64Maximum ContentLength1048576YES
Timeoutint64Timeout (ms)3000YES
CpuThresholdint64Downloading threshold,Default 900(90%),Allow range 0 to 1000900YES
SignatureSignatureConfSignature ConfigurationNO
MiddlewaresMiddlewaresConfEnable MiddlewareNO

ServiceConfig General Configuration refer to Basic Service Configuration MidslewaresConf Configuration Reference Middleware