There is an internal server on which Dicsoure stands and is open for listening on port 80, when a visitor asks for a site, it always opens in https (redirects), but all the links are in http. I do not control this infrastructure, but besides port 80 I have no way out
Sorry, I’m not following (fully understanding) your posts.
You said,
I need to implement the server so that it listens to port 80 but gives links in https. How can I solve this problem?
If I understand you directly, you want all port 80 HTTP traffic to redirect to port 443 HTTPS and you do not want to send HTTPS traffic on port 80, but only redirect port 80 to port 443.
If so, this is how most every web server is set up; and for example, if you use LetsEncrypt to set up your port 443 traffic using Apache2 or ngnix, LetsEncrypt will ask you if you want to set up this redirect and will do it for you.
As @Falco asked, what is your exact configuration? Are you running a web server like nginx or Apache2 in front of Discourse as a reverse proxy?
If so, when you set up LetsEncrypt on nginx or Apache2, the LetsEncrypt setup software will set up the “redirect all HTTP to HTTPS” for you (if you select “yes” when the configuration dialog asks).
That “desired solution” you are talking about is exactly what we advised you to do; e.g. set up your web server to redirect port 80 traffic to port 443.
and that solution requires you to modify the web server, the same as you have been advised.
So, @anton21m, we are beginning to go around in circles…
But let me repeat it again, just for you @anton21m because we want you to succeed!
You need access to the web server and have it set up where the port 80 traffic is redirected to port 443 and you need to set up the SSL certs in the same web server. If your hosting provider does not permit this, then you need to move to another hosting provider.
You might consider hosting it with one of the Discourse recommended hosting providers, because they will do all this for you easily.