Official Moodle docs concerning config.php file and wwwroot value.
Setting $CFG->wwwroot correctly
This setting must be a fixed URL (a string constant) that points to your site. Do not try to set this with any PHP code that can generate a variable URL. This is not supported, can cause strange problems and will stop command line scripts working completely. If your site is accessed from different IP addresses this should be done with a split DNS, see Masquerading
A specific correct example is seen on the above page:
$CFG->wwwroot = 'http://my.moodle.site.edu';
Your variable defined as
$_SERVER['HTTP_HOST'] = 'capacitacionfundacionbancopampa.com.ar:80';
is not the same as official.
What if you were to duplicate that line and on the duplicated line put:
... no port ... no trailing slash.
Comment out the original line ... the $_SERVER line ... by putting // in front of it. Shouldn't have to reboot server as the next click in the moodle will read config.php vaiables.
This part of definition: $_SERVER['HTTP_HOST']
That is something defined in config file for Apache - not as a variable in an application like Moodle - which runs under a web service and PHP. Apache settings control Moodle ... not the other way round.
It is not constant/consistent and regardless if it was working in the past or not it's not working now. Comment: the web is constantly evolving ... some better ... some worse ... think you happen to be caught in an issue that no one here can resolve for you with any consistency cause the variable isn't consistent. No one here controls internet/php/the web/dns ... none of it.
Now since your server has been configured that way, moodle has recorded in the DB whatever was being returned by $_SERVER['HTTP_HOST' at the time. So IF I were a teacher or admin and I had added a link to an image in the moodle, the database would have the incomplete URL's you are seeing now.
The next day ... that variable was being returned as something else ... then that's what's in the DB.
One way to verify what I am saying ...
Do a mysqldump of the database to an sql file.
Then bring up that sql file in a text editor that has 'find' ... not word ... not LibreOffice ... but a true text editor. Nano is such an editor.
Am pretty sure you will find different urls for images/resources/videos/docs/files ... if that's true ... some url's will work and many won't depending upon how your apache server is being found/seen that day.