Skip to content

A way to customize some headers

Probably best to have a controlled list, but some examples that would be awesome

  • Cache-control: means the sites performance can be massively improved - would be great to have this at a global level, so i can setup my gitlab instance behind a CDN and have all pages cached
  • Content-Security-Policy
  • Strict-Transport-Security
  • X-XSS-Protection
  • Referrer-Policy

Server global settings

  • Configuring headers for self-managed instances installed via Omnibus, you can add headers to your gitlab.rb file
gitlab_pages['headers'] = []
  • For source installations you can specify multiple -header flags when running the Pages binary
./gitlab-pages -header "header-1: value-1" -header "header-2: value-2
  • Currently, it is not possible to specify custom headers per project.
  • It is not possible to set on GitLab.com
Edited by Jaime Martinez