The form security failed because of invalid origin

We are trying to setup matamo on aks. Request flows from Azure app gateway–>nginx ingress->matamo

We have exposed traffic on https everywhere but still its giving following error whenever we login

Error : The form security failed because of invalid origin. If you previously connected using HTTPS, please ensure you are connecting over a secure (SSL/TLS) connection and try again.