by Agustín Rodríguez.
Just in case that someone has the same problem: I was trying to use the IP address of the server as a hostname and it seems that (at least my Moodle installation) Moodle was redirecting me to the hostname like address. Changing the IP Address for the hostname in the [hostname] part of the url solved my problem.
Regards!