How to set the proxy for Networks with nginx?

You have a server running Nginx and provides access to the locally hosted website Ruby on Rails
Want to this server to accommodate other networks (which he would have been available at 10.0.0.1 networks) which is installed on another server(networks is available at http://10.0.0.2) . In the nginx configuration registers :

location networks {
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;
 }

But when switching to 10.0.0.1 networks redirects me to the main page of the site.

While a similar config for piwik works perfectly.
How to correctly configure?
July 8th 19 at 11:40
1 answer
July 8th 19 at 11:42
Solution
server_addr_or_ip - change in name or IP
upstream networks-app {
least_conn;
 server server_addr_or_ip:80 weight=10 max_fails=3 fail_timeout=30s;
}

 location networks {
 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;
 }
accordingly, networks should be configured to work not from the root - logan66 commented on July 8th 19 at 11:45
Generally normalnomu do not torment the hedgehog and washed down with a subdomain :) - logan66 commented on July 8th 19 at 11:48
https://gitlab.com/gitlab-org/gitlab-git-http-serv...
To educate, down to the docks is the same - logan66 commented on July 8th 19 at 11:51
: And it is possible for it to be accessible from the root not? can podskazhesh nginx configuration for server networks? - Benton_Blick34 commented on July 8th 19 at 11:54
https://github.com/gitlabhq/gitlabhq/pull/2162 even the subdirectory.
no you can not, or or, where not only the settings of nginx and rails.
As said above, create a subdomain git.exemple.com and screw hitlab there, immediately eliminate a lot of problems. - logan66 commented on July 8th 19 at 11:57

Find more questions by tags NginxGitLab