Allow per-site custom configuration of GitLab Pages using a file in the repo
Problem to Solve
We have a number of open issues that all make requests with an attribute in common:
- #22 - HTTP Basic auth support
- #23 - route all requests to index.html
- #24 - a custom list of redirects
- #28 - Add HSTS headers
- #50 - General-purpose extra headers mechanism, particularly covering caching headers
- #66 (closed) - CORS configuration (global-only at present)
- #80 - Prevent direct access to namespace.gitlab.io
- #89 - custom MIME types per-project
- https://gitlab.com/gitlab-org/gitlab-ce/issues/42949 - canonical redirect
- https://gitlab.com/gitlab-org/gitlab-ce/issues/35141 - persist site content between runs
These all want to have custom HTTP server configurations for their sites.
Rather than picking piecemeal solutions, it would be nice to consider a single solution that could support all these use cases in a standard, unified way: through a
.gitlab-pages.yml containing the appropriate configuration.
We should choose one or two initial configurations (perhaps #23, #28, https://gitlab.com/gitlab-org/gitlab-ce/issues/42949) to prove out the feature, and then we can schedule the rest.
At least initially, the MVC will support reading configuration only for sites using custom domains. There are domain-level configurations that could conflict between projects using the same domain.