Gitlab and NGINX setup -
i trying configure existing nginx work gitlab omnibus on centos. have application (app a) installed uses 127.0.0.1:3838. far have nginx setup going site ip 12.345.678.910, able redirect app a. setup gitlab when go 12.345.678.910/gitlab, redirects me gitlab. idea run gitlab on http://127.0.0.1:8081, , have nginx redirect 12.345.678.910/gitlab localhost:8081.
i've followed these links help:
https://docs.gitlab.com/omnibus/settings/nginx.html#using-a-non-bundled-web-server.
forwarding gitlab subdomain existing nginx installation
edited /etc/gitlab/gitlab.rb
external_url = 'http://127.0.0.1:8081' nginx['enable'] = false web_server['external_users'] = ['nginx']
new config file /etc/nginx/sites-enabled/gitlab
upstream gitlab-workhorse { server unix:/var/opt/gitlab/gitlab-workhorse/socket; } server { listen 0.0.0.0:8081; listen [::]:8081; server_name localhost; server_tokens off; root /opt/gitlab/embedded/service/gitlab-rails/public; access_log /var/log/nginx/gitlab_access.log; error_log /var/log/nginx/gitlab_error.log; location / { client_max_body_size 0; gzip off; proxy_read_timeout 300; proxy_connect_timeout 300; proxy_redirect off; proxy_http_version 1.1; proxy_set_header host $http_host; proxy_set_header x-real-ip $remote_addr; proxy_set_header x-forwarded-for $proxy_add_x_forwarded_for; proxy_set_header x-forwarded-proto $scheme; proxy_pass http://gitlab-workhorse; } }
added /etc/nginx/conf.d/default.conf:
server { listen 80 default_server; server_name localhost; location / { root /usr/share/nginx/html; index index.html index.htm; } location /gitlab { proxy_pass http://127.0.0.1:8081; }
i've added 'nginx' gitlab-www group. ran nginx restart , gitlab reconfigure commands.
sudo usermod -ag gitlab-www nginx sudo service nginx restart sudo gitlab-ctl reconfigure && gitlab-ctl restart
i installed passenger per comment in link above, didn't solve issue. when go 12.345.678.910/gitlab page not found error.
i still new , appreciated.
Comments
Post a Comment