Answer the question
In order to leave comments, you need to log in
How to set proxy for Gitlab in nginx?
There is a server on which Nginx is running and provides access to a locally hosted site on Ruby on Rails.
I want to add gitlab to this server (so that it is available at 10.0.0.1/gitlab) which is installed on another server (gitlab is available at http:/ /10.0.0.2) . In the nginx config I write:
location /gitlab {
proxy_pass http://10.0.0.2/;
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
Answer the question
In order to leave comments, you need to log in
server_addr_or_ip - change to domain name or IP
upstream gitlab-app {
least_conn;
server server_addr_or_ip:80 weight=10 max_fails=3 fail_timeout=30s;
}
location /gitlab {
proxy_pass http://gitlab-app;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question