Pages Error 502

Hello community,

we have a problem with Gitlab Pages.
When retrieving a page, we get the error message 502.
The log file (/var/log/gitlab/gitlab-pages/current)gives the following error message:

{"correlation_id":"01FFF3V9PQKTBHA50HF0XA3C6D","error":"Get \"OUR PAGES DOMAIN\": dial tcp XXX.XXX.XXX.XXX:443: connect: no route to host","host":"OUR DOMAIN","level":"error","msg":"could not fetch domain information from a source","path":"/favicon.ico","time":"2021-09-13T10:19:47+02:00"}

Here it is interesting that the IP XXX.XXX.XXX.XXX is not the IP of the server, it is an IP that is not assigned in out network.
We use version 14.2.3. The problems may have arisen when switching to version 14.

I have the same problem with version number 14.0.10 on docker. It gives me the same error message. Is that a bug?

Could it be useful to test the following?

Update: We found a solution in our case. We use an older docker-compose.yml file, which contains a “hostname” attribute. We did set this do our fully qualified gitlab hostname, because we don’t know the impact and runs it for many years. We now changed this back to a neutral “gitlab”, which also works, because it only define linux hostname of docker container, but do not collide with our fqdn.

Old answer
I suppose you both are using SSL termination with an external nginx or traefik, correct?
In this case, docs propose to set nginx of docker image to only listen on http port.

We just created an issue for gitlab (Gitlab Pages throw 502 error in Docker environment after update from 13.12 to 14.02 (#341585) · Issues · / GitLab · GitLab), because the gitlab-ce docker image write local docker ip into /etc/hosts file. And because gitlab-pages was switch to “gitlab” configuration check in 14.0 or 14.1, the gitlab-pages request, which isn’t reachable from within docker imagem, when you use documented configuration in this case.

(And request goes to local nginx only, because the hostname is related to local IP) → 502
Workaroung is explained within the issue

After entering the correct IP in the \etc\hosts and updating to version 14.3, the pages seem to be running again.
Many thanks for the support