semaphoreui/semaphore · error
You can't use both HTTP redirect address and port at the…
Error message
You can't use both HTTP redirect address and port at the same time
What it means
The server startup (runService) rejects configurations that set both TLS.HTTPRedirectAddr and TLS.HTTPRedirectPort. Both control where the HTTP-to-HTTPS redirect listener binds, so specifying both is treated as a contradictory config and the process panics.
Solutions
- Remove either tls.http_redirect_port or tls.http_redirect_addr from the config so only one is set
- If you used an env var to set one of them (e.g. SEMAPHORE_TLS_HTTP_REDIRECT_PORT), unset it or drop the config counterpart
- Keep TLS.Enabled true with exactly one redirect specification and restart
Example fix
// before (config) tls: enabled: true http_redirect_port: 80 http_redirect_addr: ":80" // after tls: enabled: true http_redirect_addr: ":80"
Defensive patterns
Strategy: validation
Validate before calling
grep -nE 'http_redirect_(port|addr)' /etc/semaphore/config.json # ensure at most one is set
Prevention
- Set only one of http_redirect_port or http_redirect_addr
- Audit config plus env-var overlays for the same TLS keys
- Prefer the addr form in new configs and remove legacy port fields
- Validate the config with a startup smoke test in CI
When it happens
Trigger: Starting semaphore with TLS enabled and a config file that contains both `tls.http_redirect_addr: ":80"` and a non-nil `http_redirect_port` (e.g. 80), or setting one via env var and the other via config file.
Common situations: Migrating old configs that used the port form while also copying a newer config snippet using the addr form; environment variables layered on top of a config file; copy-pasted example configs.
Understand the failure class
Background: Conflicting config options: "cannot be used together" — configuration validation errors across open-source libraries — this error's family across 162 libraries.
Related errors
- encryption_keys.keys_folder: read
- Could not decode configuration!
- Cannot specify both --undo-to and --apply-to
- http requests forbidden
- cannot assign value of type %T to field
AI-assisted analysis of semaphoreui/semaphore@1774ccb71a (2026-09-07).
Data as JSON: /api/errors/253bfec6d51f2e2b.
Report an issue: GitHub.
Appendix: source
Thrown at cli/cmd/root.go:350
next.ServeHTTP(w, r)
})
})
var router http.Handler = route
router = handlers.ProxyHeaders(router)
http.Handle("/", router)
fmt.Println("Server is running")
defer store.Close()
var err error
if util.Config.TLS.Enabled {
if util.Config.TLS.HTTPRedirectPort != nil && util.Config.TLS.HTTPRedirectAddr != "" {
panic("You can't use both HTTP redirect address and port at the same time")
}
var httpRedirectAddr string
if util.Config.TLS.HTTPRedirectPort != nil {
httpRedirectAddr = fmt.Sprintf(":%d", *util.Config.TLS.HTTPRedirectPort)
} else if util.Config.TLS.HTTPRedirectAddr != "" {
httpRedirectAddr = util.Config.TLS.HTTPRedirectAddr
}
if httpRedirectAddr != "" {
go func() {
err = http.ListenAndServe(httpRedirectAddr, http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
target := "https://"
if util.Config.WebHost != "" {View on GitHub (pinned to 1774ccb71a)