Undefined method `chomp' for nil:NilClass when configuring gitlab pages

I am following this guide to enable gitlab pages. There it says that I should need only

pages_external_url 'http://example.io'

if I want wildcard domains (plus the DNS setup, of course). However, when I do that i get an undefined variable error when running gitlab-ctl-reconfigure

/opt/gitlab/embedded/cookbooks/cache/cookbooks/gitlab-pages/libraries/gitlab_pages.rb:

 72:          Gitlab['gitlab_pages']['cert'] ||= "/etc/gitlab/ssl/#{Gitlab['gitlab_pages']['domain']}.crt"
 73:          Gitlab['gitlab_pages']['cert_key'] ||= "/etc/gitlab/ssl/#{Gitlab['gitlab_pages']['domain']}.key"
 74:        end
 75:  
 76:        Gitlab['gitlab_pages']['pages_root'] ||= (Gitlab['gitlab_rails']['pages_path'] || File.join(Gitlab['gitlab_rails']['shared_path'], 'pages'))
 77:  
 78:        Gitlab['gitlab_pages']['gitlab_server'] ||= Gitlab['external_url']
 79>>       Gitlab['gitlab_pages']['artifacts_server_url'] ||= Gitlab['gitlab_pages']['gitlab_server'].chomp('/') + '/api/v4'
 80:  
 81:        parse_auth_redirect_uri
 82:      end
 83:  
 84:      def parse_auth_redirect_uri
 85:        return unless Gitlab['gitlab_pages']['access_control']
 86:        return if Gitlab['gitlab_pages']['auth_redirect_uri']
 87:  
 88:        pages_uri = URI(Gitlab['pages_external_url'].to_s)

System Info:
------------
chef_version=17.10.0
platform=ubuntu
platform_version=22.04
ruby=ruby 3.0.6p216 (2023-03-30 revision 23a532679b) [x86_64-linux]
program_name=/opt/gitlab/embedded/bin/cinc-client
executable=/opt/gitlab/embedded/bin/cinc-client


Running handlers:
[2023-09-26T16:06:08+02:00] ERROR: Running exception handlers
There was an error running gitlab-ctl reconfigure:

undefined method `chomp' for nil:NilClass

If I add

gitlab_pages['gitlab_server'] = external_url

then it seems to be working (so far), but the docs seem to be implying that this is the default anyway. What am I missing here? Furthermore, what is the purpose of

#gitlab_pages['enable'] = false

which seems to be commented out and default to false, and I still have it set to false, but I’m still able to generate pages.

gitlab is 16.1.4-ee.0