Change GitLab Pages URL scheme to

On my self hosted GitLab installation pages have URL scheme Is it possible to change it so that pages are accessible at 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 $;
    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;

But as a result I get 401 Unauthorized error.