Pages NGINX configuration for namespace in path
What does this MR do?
The logic for namespace in path for Pages has been shifted from NGINX to Pages code base. In this MR, we are removing that extra NGINX configuration.
NGINX configuration has been updated to allow either namespace in path or namespace in host (i.e. wildcard) and NOT both (Reference).
Test Plan:
- Install CE build from this MR.
- Enable namespace in path: https://docs.gitlab.com/ee/administration/pages/#pages-domain-without-wildcard-dns
- Check the GitLab Pages NGINX configuration at
/var/opt/gitlab/nginx/conf/gitlab-pages.conf
. There should be oneserver
block with the followingserver_name
whenpages_external_url
ishttps://pages.example.io/
:
server_name ~^pages\.example\.io$;
To test with a Pages binary that supports namespace in the path:
- Clone the GitLab Pages code:
git clone https://gitlab.com/gitlab-org/gitlab-pages.git
- Go inside the cloned directory:
cd gitlab-pages
- Perform
git pull
if repo is not recently updated. -
Checkout the(As Pages MR got merged)ngala/namespace-in-path-handler
branch:git checkout ngala/namespace-in-path-handler
- Stop the GitLab Pages process:
sudo gitlab-ctl stop gitlab-pages
- Prepare the Pages binary:
sudo make build
- Transfer the binary (Replace
<PAGES_DIRECTORY>
with the above cloned location):sudo mv <PAGES_DIRECTORY>/bin/gitlab-pages /opt/gitlab/embedded/bin/
- Restart the GitLab Pages process:
sudo gitlab-ctl start gitlab-pages
- Log in to GitLab and create a public HTML project from the template: https://docs.gitlab.com/ee/user/project/pages/getting_started/pages_new_project_template.html
- When the pipeline is finished, go to Deploy > Pages to find the link to the Pages website.
- Verify that the namespace is included in the path (e.g.,
https://<PAGES_URL>/namespace/<PROJECT_NAME>
) and that navigating to the Pages URL loads the Pages static website.
Changelog: added
Related issues
Omnibus configuration - Pages without DNS wildc... (#8581 - closed)
Checklist
See Definition of done.
For anything in this list which will not be completed, please provide a reason in the MR discussion.
Required
-
MR title and description are up to date, accurate, and descriptive. -
MR targeting the appropriate branch. -
Latest Merge Result pipeline is green. -
When ready for review, MR is labeled "~workflow::ready for review" per the Distribution MR workflow.
For GitLab team members
If you don't have access to this, the reviewer should trigger these jobs for you during the review process.
-
The manual Trigger:ee-package
jobs have a green pipeline running against latest commit. -
If config/software
orconfig/patches
directories are changed, make sure thebuild-package-on-all-os
job within theTrigger:ee-package
downstream pipeline succeeded. -
If you are changing anything SSL related, then the Trigger:package:fips
manual job within theTrigger:ee-package
downstream pipeline must succeed. -
If CI configuration is changed, the branch must be pushed to dev.gitlab.org
to confirm regular branch builds aren't broken.
Expected (please provide an explanation if not completing)
-
Test plan indicating conditions for success has been posted and passes. -
Documentation created/updated. -
Tests added. -
Integration tests added to GitLab QA. -
Equivalent MR/issue for the GitLab Chart opened. -
Validate potential values for new configuration settings. Formats such as integer 10
, duration10s
, URIscheme://user:passwd@host:port
may require quotation or other special handling when rendered in a template and written to a configuration file.
Edited by Naman Jagdish Gala