502 from Gitlab-pages on artifacts preview
Summary
Gitlab-Pages displays 502 on artifacts preview
Steps to reproduce
- On Job page click on "Browse" in Job artifacts section
- Chose index.html file
- Click on link displayed on "You are being redirected away from GitLab" page
- Got 502
Relevant logs and/or screenshots
Log from gitlab-pages
{"level":"info","msg":"http: invalid Content-Length of \"-1\"","time":"2023-07-13T11:50:24+02:00"}
Gitlab version
gitlab-omnibus v16.1.1
Possible fixes
In /var/opt/gitlab/nginx/conf/gitlab-pages.conf I added:
proxy_http_version 1.1;
proxy_set_header Connection "";
after "proxy_set_header X-Forwarded-Proto http;" what fixed the problem.