Skip to content

Commit 198e4c4

Browse files
balasankarcngala
andcommitted
Merge branch 'ngala/fix-pages-nginx' into 'master'
Fix Pages Nginx location block rendering incorrect file See merge request https://gitlab.com/gitlab-org/omnibus-gitlab/-/merge_requests/7303 Merged-by: Balasankar 'Balu' C <[email protected]> Approved-by: Balasankar 'Balu' C <[email protected]> Approved-by: Clemens Beck <[email protected]> Co-authored-by: ngala <[email protected]>
2 parents 77527d4 + b9c361a commit 198e4c4

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

files/gitlab-cookbooks/gitlab/templates/default/nginx-gitlab-pages-http.conf.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ server {
5050
<% end %>
5151
proxy_set_header X-Gitlab-Namespace-In-Path $namespace;
5252

53-
<%= render "nginx-gitlab-pages-http-common-server.erb" %>
53+
<%= render "nginx-gitlab-pages-http-common-location.erb" %>
5454

5555
## Put namespace in path from host before sending it to the user
5656
<% @proxy_redirect.each do |redirect| %>

spec/chef/cookbooks/gitlab/recipes/nginx_spec.rb

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -921,6 +921,11 @@
921921
expect(content).to include('proxy_redirect ~^//(.*)\.(pages\.localhost)/(.*)$ /$1/$3;')
922922
expect(content).to include('proxy_redirect ~^/(.*)$ /$namespace/$1;')
923923
expect(content).to include('proxy_hide_header X-Gitlab-Namespace-In-Path;')
924+
# Below checks are to verify proper render entries are made
925+
expect(content).to include('proxy_http_version 1.1;').twice
926+
expect(content).to include('proxy_pass').twice
927+
expect(content).to include('disable_symlinks on;').twice
928+
expect(content).to include('server_tokens off;').twice
924929
}
925930
end
926931
end
@@ -945,6 +950,11 @@
945950
expect(content).not_to include('proxy_redirect ~^//(.*)\.(pages\.localhost)/(.*)$ /$1/$3;')
946951
expect(content).not_to include('proxy_redirect ~^/(.*)$ /$namespace/$1;')
947952
expect(content).to include('proxy_hide_header X-Gitlab-Namespace-In-Path;')
953+
# Below checks are to verify proper render entries are made
954+
expect(content).to include('proxy_http_version 1.1;').once
955+
expect(content).to include('proxy_pass').once
956+
expect(content).to include('disable_symlinks on;').once
957+
expect(content).to include('server_tokens off;').once
948958
}
949959
end
950960
end

0 commit comments

Comments
 (0)