diff --git a/internal/config/config.go b/internal/config/config.go index ee376822..b475a6b3 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -204,12 +204,13 @@ func (cfg *Config) StartServers(opts ...*StartServersOptions) { opt := opts[0] if opt.Proxy { server.StartServer(cfg.task, server.Options{ - Name: "proxy", - CertProvider: cfg.AutoCertProvider(), - HTTPAddr: common.ProxyHTTPAddr, - HTTPSAddr: common.ProxyHTTPSAddr, - Handler: cfg.entrypoint, - ACL: cfg.value.ACL, + Name: "proxy", + CertProvider: cfg.AutoCertProvider(), + HTTPAddr: common.ProxyHTTPAddr, + HTTPSAddr: common.ProxyHTTPSAddr, + Handler: cfg.entrypoint, + ACL: cfg.value.ACL, + SupportProxyProtocol: cfg.value.Entrypoint.SupportProxyProtocol, }) } if opt.API { diff --git a/internal/config/types/config.go b/internal/config/types/config.go index 0396bf69..f5f0fbb0 100644 --- a/internal/config/types/config.go +++ b/internal/config/types/config.go @@ -37,8 +37,9 @@ type ( MaxMind *maxmind.Config `json:"maxmind" yaml:"maxmind,omitempty"` } Entrypoint struct { - Middlewares []map[string]any `json:"middlewares"` - AccessLog *accesslog.RequestLoggerConfig `json:"access_log" validate:"omitempty"` + SupportProxyProtocol bool `json:"support_proxy_protocol"` + Middlewares []map[string]any `json:"middlewares"` + AccessLog *accesslog.RequestLoggerConfig `json:"access_log" validate:"omitempty"` } HomepageConfig struct { UseDefaultCategories bool `json:"use_default_categories"`