#2643·warpgate

404 when Logging in using Caddy as a Reverse Proxy

Author: j0haxCreated Sep 27, 2026Updated Sep 27, 2026

Hello,

I am trying to use Warpgate + Caddy on a NixOS server.

Logging in to Warpgate works via the default native port (localhost:8888), but with Caddy the Log-In breaks, resulting a 404 in the browser console/logs and giving the appearance of constant redirects to the log-in screen.

Native Port 8888

Forwarding Port 8888 from my Server to my local box port 3000 via SSH and accessing the https://localhost:3000 results in these logs:

Sep 27 21:18:51 skylab warpgate[69519]: 27.09.2026 21:18:51  INFO HTTP: audit: Authenticated _type="UserAuthenticated1" session=192dc468-b8d9-451b-a37a-b0210a4ee1c4 client_ip=::1 user_id=7df6ea36-e74b-41fb-8f74-ae4478514080 username=admin credentials=password (1476a3a4-4d28-4186-88d9-05d914d68670) related_users=$7df6ea36-e74b-41fb-8f74-ae4478514080$
Sep 27 21:18:51 skylab warpgate[69519]: 27.09.2026 21:18:51  INFO HTTP: warpgate_common_http::logging: Request method=POST url=https://localhost:3000/@warpgate/api/auth/login status=201 Created client_ip=::1
Sep 27 21:18:51 skylab warpgate[69519]: 27.09.2026 21:18:51  INFO HTTP{session=192dc468-b8d9-451b-a37a-b0210a4ee1c4 session_username=admin client_ip=::1}: warpgate_common_http::logging: Request method=GET url=https://localhost:3000/@warpgate/api/info status=200 OK client_ip=::1
Sep 27 21:18:52 skylab warpgate[69519]: 27.09.2026 21:18:52  INFO HTTP{session=192dc468-b8d9-451b-a37a-b0210a4ee1c4 session_username=admin client_ip=::1}: warpgate_common_http::logging: Request method=GET url=https://localhost:3000/@warpgate/api/info status=200 OK client_ip=::1
Sep 27 21:18:52 skylab warpgate[69519]: 27.09.2026 21:18:52  INFO HTTP{session=192dc468-b8d9-451b-a37a-b0210a4ee1c4 session_username=admin client_ip=::1}: warpgate_common_http::logging: Request method=GET url=https://localhost:3000/@warpgate/api/auth/web-auth-requests status=200 OK client_ip=::1
Sep 27 21:18:52 skylab warpgate[69519]: 27.09.2026 21:18:52  INFO HTTP{session=192dc468-b8d9-451b-a37a-b0210a4ee1c4 session_username=admin client_ip=::1}: warpgate_common_http::logging: Request method=GET url=https://localhost:3000/@warpgate/admin/api/ticket-requests?status=Pending status=200 OK client_ip=::1
Sep 27 21:18:52 skylab warpgate[69519]: 27.09.2026 21:18:52  INFO HTTP{session=192dc468-b8d9-451b-a37a-b0210a4ee1c4 session_username=admin client_ip=::1}: warpgate_common_http::logging: Request method=GET url=https://localhost:3000/@warpgate/api/auth/web-auth-requests status=200 OK client_ip=::1
Sep 27 21:18:52 skylab warpgate[69519]: 27.09.2026 21:18:52  INFO HTTP{session=192dc468-b8d9-451b-a37a-b0210a4ee1c4 session_username=admin client_ip=::1}: warpgate_common_http::logging: Request method=GET url=https://localhost:3000/@warpgate/admin/api/session-approvals status=200 OK client_ip=::1
Sep 27 21:18:52 skylab warpgate[69519]: 27.09.2026 21:18:52  INFO HTTP{session=192dc468-b8d9-451b-a37a-b0210a4ee1c4 session_username=admin client_ip=::1}: warpgate_common_http::logging: Request method=GET url=https://localhost:3000/@warpgate/api/auth/web-auth-requests status=200 OK client_ip=::1
Sep 27 21:18:52 skylab warpgate[69519]: 27.09.2026 21:18:52  INFO HTTP{session=192dc468-b8d9-451b-a37a-b0210a4ee1c4 session_username=admin client_ip=::1}: warpgate_common_http::logging: Request method=GET url=https://localhost:3000/@warpgate/admin/api/ticket-requests?status=Pending status=200 OK client_ip=::1
Sep 27 21:18:52 skylab warpgate[69519]: 27.09.2026 21:18:52  INFO HTTP{session=192dc468-b8d9-451b-a37a-b0210a4ee1c4 session_username=admin client_ip=::1}: warpgate_common_http::logging: Request method=GET url=https://localhost:3000/@warpgate/admin/api/session-approvals status=200 OK client_ip=::1
Sep 27 21:18:52 skylab warpgate[69519]: 27.09.2026 21:18:52  INFO HTTP{session=192dc468-b8d9-451b-a37a-b0210a4ee1c4 session_username=admin client_ip=::1}: warpgate_common_http::logging: Request method=GET url=/@warpgate/api/auth/web-auth-requests/stream status=101 Switching Protocols client_ip=::1
Sep 27 21:18:52 skylab warpgate[69519]: 27.09.2026 21:18:52  INFO HTTP{session=192dc468-b8d9-451b-a37a-b0210a4ee1c4 session_username=admin client_ip=::1}: warpgate_common_http::logging: Request method=GET url=https://localhost:3000/@warpgate/api/targets?search= status=200 OK client_ip=::1
Sep 27 21:18:52 skylab warpgate[69519]: 27.09.2026 21:18:52  INFO HTTP{session=192dc468-b8d9-451b-a37a-b0210a4ee1c4 session_username=admin client_ip=::1}: warpgate_common_http::logging: Request method=GET url=/@warpgate/api/auth/web-auth-requests/stream status=101 Switching Protocols client_ip=::1
Sep 27 21:18:52 skylab warpgate[69519]: 27.09.2026 21:18:52  INFO HTTP{session=192dc468-b8d9-451b-a37a-b0210a4ee1c4 session_username=admin client_ip=::1}: warpgate_common_http::logging: Request method=GET url=/@warpgate/admin/api/session-approvals/changes status=101 Switching Protocols client_ip=::1

With Caddy

My Caddy-Config is quite simple:

caddy
gate.my.domain *.gate.my.domain {
	encode
	reverse_proxy https://127.0.0.1:8888 {
		transport http {
			tls_insecure_skip_verify
		}
	}
}

It should effectively be a TLS reverse proxy which by default, sets all headers required per Warpgate documentation:

Sep 27 21:16:49 skylab warpgate[69519]: 27.09.2026 21:16:49  INFO HTTP: audit: Authenticated _type="UserAuthenticated1" session=a27eafce-98d7-4710-a4a6-3001914e36c5 client_ip=xxx.xxx.xxx.xxx user_id=7df6ea36-e74b-41fb-8f74-ae4478514080 username=admin credentials=password (1476a3a4-4d28-4186-88d9-05d914d68670) related_users=$7df6ea36-e74b-41fb-8f74-ae4478514080$
Sep 27 21:16:49 skylab warpgate[69519]: 27.09.2026 21:16:49  INFO HTTP: warpgate_common_http::logging: Request method=POST url=https://127.0.0.1:8888/@warpgate/api/auth/login status=201 Created client_ip=xxx.xxx.xxx.xxx
Sep 27 21:16:49 skylab warpgate[69519]: 27.09.2026 21:16:49  INFO HTTP: warpgate_common_http::logging: Request method=GET url=https://127.0.0.1:8888/@warpgate/api/info status=200 OK client_ip=xxx.xxx.xxx.xxx
Sep 27 21:16:49 skylab warpgate[69519]: 27.09.2026 21:16:49  INFO HTTP: warpgate_common_http::logging: Request method=GET url=https://127.0.0.1:8888/@warpgate/api/info status=200 OK client_ip=xxx.xxx.xxx.xxx
Sep 27 21:16:49 skylab warpgate[69519]: 27.09.2026 21:16:49  INFO HTTP: warpgate_common_http::logging: Request method=GET url=https://127.0.0.1:8888/@warpgate/api/info status=200 OK client_ip=xxx.xxx.xxx.xxx
Sep 27 21:16:49 skylab warpgate[69519]: 27.09.2026 21:16:49  INFO HTTP: warpgate_common_http::logging: Request method=GET url=https://127.0.0.1:8888/@warpgate/api/sso/providers status=200 OK client_ip=xxx.xxx.xxx.xxx
Sep 27 21:16:49 skylab warpgate[69519]: 27.09.2026 21:16:49  WARN HTTP: warpgate_common_http::logging: Request failed method=GET url=https://127.0.0.1:8888/@warpgate/api/auth/state status=404 Not Found client_ip=xxx.xxx.xxx.xxx

(Note the last line giving a 404)

I also have these sections in my config.yaml:

yaml
external_host: gate.my.domain
http:
  certificate: /var/lib/warpgate/tls.certificate.pem
  cookie_max_age: 1day
  external_host: gate.my.domain
  external_port: 443
  key: /var/lib/warpgate/tls.key.pem
  listen: '[::]:8888'
  session_max_age: 30m
  sni_certificates: []
  trust_x_forwarded_headers: true