Service Configuration

Overview

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

Configuration Description

golang Structure Definition:

  1. RestConf struct {
  2. service.ServiceConf
  3. Host string `json:",default=0.0.0.0"`
  4. Port int
  5. CertFile string `json:",optional"`
  6. KeyFile string `json:",optional"`
  7. Verbose bool `json:",optional"`
  8. MaxConns int `json:",default=10000"`
  9. MaxBytes int64 `json:",default=1048576"`
  10. // milliseconds
  11. Timeout int64 `json:",default=3000"`
  12. CpuThreshold int64 `json:",default=900,range=[0:1000]"`
  13. Signature SignatureConf `json:",optional"`
  14. Middlewares MiddlewaresConf
  15. }

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