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

  1. Remove either tls.http_redirect_port or tls.http_redirect_addr from the config so only one is set
  2. 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
  3. 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

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


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)