ELASTICSEARCH HTTPS ok internally, but bad gateway 502 externally. KIBANA ok both over HTTP

Hi everyone, I'm just coming here after almost 3 whole days of trying to make it work and not going.

I have the following schema:

AZURE AKS > NGINX CONTROLLER (which creates a loadbalancer when it has an ingress) > APPLICATION GATEWAY

KIBANA on HTTP is working ok, both internally and externally to the outside internet.

ELASTICSEARCH is HTTPS and internally it is working by accessing its ingress in the same VNET as AKS, but externally when it reaches the APPLICATION GATEWAY it gives bad gateway 502;

I believe it would be the certificate that I need to put in APPGATEWAY, but it's not working, does anyone have any idea how to disable SSL or HTTPS in ELASTICSEARCH?

xpack.security.http.ssl is not working, I put it inside yalm when installing in helm and it does not deactivate and using --sett I did not find the veriavel. Or if they gave me a way to get the certificate, that would also be a great help.