GLPages returns "The requested URL was not found on this server."

Hi!

I have docker gitlab instance at gitlab.example.io. So i configured in gitlab.rb:
pages_external_url "http://pages.example.io"
gitlab_pages['enable'] = true

Both gitlab.example.io and pages.example.io at the same ip address.

Then I create simple example group with group_test name and group_nested inside. Finaly I create project with name project_test in group_nested.

It contains index.html

<head>
</head>
<body>
<p>Hello World!</p>
</body>

and .gitlab-ci.yml

stages:
  - deploy

pages:
  tags:
    - latest
  stage: deploy
  script:
    - mkdir .public
    - cp -r * .public
    - mv .public public
  artifacts:
    paths:
      - public
  only:
    - main

After pipeline finishes I get url: http://group_test.pages.example.io/group_nested/project_test and when I try to follow the link I get 404 error. Not found. The requested URL was not found on this server.

Files exist at /var/opt/gitlab/gitlab-rails/shared/pages.
DNS service has wildcard record *.example.io A ip-address.

Gitlab pages log:

==> /var/log/gitlab/gitlab-pages/current <==
{"level":"info","msg":"Checking GitLab internal API availability","time":"2021-09-19T21:21:40+03:00"}
{"error":"failed to connect to internal Pages API: HTTP status: 502","level":"warning","msg":"attempted to connect to the API","time":"2021-09-19T21:21:40+03:00"}
{"level":"info","msg":"Checking GitLab internal API availability","time":"2021-09-19T21:21:44+03:00"}
{"error":"failed to connect to internal Pages API: HTTP status: 502","level":"warning","msg":"attempted to connect to the API","time":"2021-09-19T21:21:44+03:00"}
{"level":"info","msg":"Checking GitLab internal API availability","time":"2021-09-19T21:21:49+03:00"}
{"error":"failed to connect to internal Pages API: HTTP status: 502","level":"warning","msg":"attempted to connect to the API","time":"2021-09-19T21:21:49+03:00"}
{"level":"info","msg":"Checking GitLab internal API availability","time":"2021-09-19T21:21:55+03:00"}
{"error":"failed to connect to internal Pages API: HTTP status: 502","level":"warning","msg":"attempted to connect to the API","time":"2021-09-19T21:21:55+03:00"}
{"level":"info","msg":"Checking GitLab internal API availability","time":"2021-09-19T21:22:03+03:00"}
{"level":"info","msg":"GitLab internal pages status API connected successfully","time":"2021-09-19T21:22:03+03:00"}

What is wrong?