Gitlab Pages nginx config (for Web Key Directory)

I am trying to serve a Web Key Directory (WKD) on a Jekyll page created by Omnibus Gitlab Pages. This checker tells me that everything is in place and works, except that the key is not accessible:

  • Key file found
  • Key format correct
  • Key is not accessible, add ‘Access-Control-Allow-Origin: *’ header
  • Policy file found

So I am trying to tell Gitlab nginx to add that configuration. In gitlab.rb I set the following:

pages_nginx['custom_gitlab_server_config'] = "include /etc/gitlab/pages_nginx/*.conf;"

In /etc/gitlab/pages_nginx/ I have added a file openpgpkey.conf with the following content:

location /.well-known/openpgpkey/hu/ {
  add_header Access-Control-Allow-Origin *;

and restarted nginx with gitlab-ctl restart nginx Now the checker returns this:

  • Key not found
  • Policy file found

Removing openpgpkey.conf and restarting nginx returns the original checker output. So it looks like setting this file rather breaks pages than adding settings.

What do I need to do to get this straight?