I am trying to run Jenkins CI listening on port 8081 behind GitLab NGINX server.
- I am a GitLab and NGINX newbie.
- I am running GitLab and Jenkins on a CentOS 6.7 server IP 172.17.144.81
- Jenkins has no prefix and is running on port 8081
I added following line to gitlab.rb
nginx['custom_nginx_config'] = "include /var/opt/gitlab/nginx/conf/nginx-jenkins.conf;"
After running gitlab-ctl reconfigure and gitlab-ctl restart, the /var/opt/gitlab/nginx/conf/nginx.conf file now contains:
http {
...
include /var/opt/gitlab/nginx/conf/nginx-jenkins.conf;
}
The /var/opt/gitlab/nginx/conf/nginx-jenkins.conf looks like this:
server {
listen 80;
location /jenkins {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_pass http://127.0.0.1:8081;
}
}
- http://172.17.144.81:8081 opens Jenkins as expected
- http://172.17.144.81 opens GitLab http://172.17.144.81/users/sign_in as expected
-
http://172.17.144.81/jenkins also opens GitLab http://172.17.144.81/users/sign_in
jenkins
I expected it to pass through to 8081 and open Jenkins?
Thanks in advance for any suggestions,
-Ed