X-forwarded-host needlessly includes port 443 on mobile only

I’m posting here since I don’t know exactly which part of the equation causes this.

My stack is: microk8s → metallb → ingress-nginx → aspnet app

Recently I noticed an error in my frontend app, which was due to the request host reported by ASP not matching the url of the browser. This is from aspnet Request.Host property, but it uses the one from the proxy X-FORWARDED-** headers.

When I print them from a request coming from a mobile phone I see:

x-forwarded-host=dev.myhost.com:443
x-forwarded-port=443

When I print them from a request coming from a PC I see:

x-forwarded-host=dev.myhost.com
x-forwarded-port=443

The confusion comes from the fact that I also have a cluster on AWS using the same ingress-nginx version and config, and it does not show that problem.

It also wasn’t happening not so long ago. I believe (but can’t be sure) it might have started after I updated microk8s from 1.31 to 1.33.