Change GitLab Pages URL scheme to project.namespace.pages.example.org

On my self hosted GitLab installation pages have URL scheme namespace.pages.example.org/project/. Is it possible to change it so that pages are accessible at project.namespace.pages.example.org instead so that project name is a part of domain name?
I have not found any options in GitLab for that.

Pages are behind nginx reverse proxy so I also tried the following configuration to change the URL:

server_name ~^(?<project>.+)\.(?<namespace>.+)\.pages\.example\.org$;

location / {
    proxy_redirect off;
    proxy_buffering off;
    proxy_set_header REMOTE_ADDR $remote_addr;
    proxy_set_header HOST $namespace.pages.example.org;
    proxy_set_header X-Forwarded-Proto $scheme;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header X-Url-Scheme $scheme;
    proxy_pass http://127.0.0.1:8090/$project/;
}

But as a result I get 401 Unauthorized error.