I ran into a similar issue when installing Rancher on K3s using SSL off-load and public certificates. The fix for me was to add an additional manifest to K3s' Traefik load balancer so that it would honor the additional headers that were being passed back to it. More details here:
Traefik and header forwarding references:
https://github.com/rancher/rancher/issues/31071
https://github.com/rancher/rancher/issues/35088
Here is the text of my own manifest file:
nano /var/lib/rancher/k3s/server/manifests/traefik-config.yaml
# update to allow trusted headers:
apiVersion:
helm.cattle.io/v1
kind: HelmChartConfig
metadata:
name: traefik
namespace: kube-system
spec:
valuesContent: |-
additionalArguments:
- "--entryPoints.web.proxyProtocol.insecure"
- "--entryPoints.web.forwardedHeaders.insecure"