504 error when entering credentials at the web interface

What type of hardware are you using: Other ARM board
What YunoHost version are you running: Latest
How are you able to access your server: The webadmin
SSH
Are you in a special context or did you perform specific tweaking on your YunoHost instance ?: The server connects to the Internet through Wireguard following the guide on the first post of Homemade WireGuard VPN on a VPS server

Describe your issue

I can connect locally without a problem. I can also connect through the Internet (configured as in the mentioned link) to the web interface, but when entering my credentials I get the following error:

[POST] “https://mydomain.tld/yunohost/portalapi/login”: 504

Share relevant logs or error messages

Diagnosis shows everything is ok but a port 25 email issue.

This is what I get.

How should I troubleshoot it?

Thanks!

Found another issue. I can ssh the server through the LAN, but when trying through the Internet I get a:
Permission denied, please try again.

Logs for 5xx errors can be found in the nginx logs
Webadmin >tools >services >nginx

Oh, thanks, did not know logs could be taken so easily from there!

This is what I get:

Anyone sees a clue on those logs that could lead to some kind of troubleshooting?

Thank you