0

nginx(ng1): 172.168.240.5

Gitlab includ nginx (ng2): 172.168.240.55

ng1 config

listen       81;
server_name  ng1;
location /gitlab/ {
    proxy_pass 172.168.240.55/
}

how can I keep port and url without updating ng2. // only modify ng1

url gitlab lost

it's login(POST) http://ng1:81/gitlab/users/sign_in

but it's show http://ng1:81/users/sign_in instead of http://ng1:81/gitlab/users/sign_in

it seems to be rewrite by ng2

url gitlab and port lost

click one file in http://ng1:81/gitlab/root/pg/

but it's http://ng1/root/pg/index.html instead of http://ng1:81/gitlab/root/pg/index.html

J. Allen
  • 11
  • 4
  • You post is a bit unclear. You are getting `http://ng1/root/pg/index.html` instead of `http://ng1:81/gitlab/root/pg/index.html`? – Tarun Lalwani May 13 '20 at 09:42
  • yes http://ng1/root/pg/index.html instead of http://ng1:81/gitlab/root/pg/index.html,it's seem to be rewrite by gitlab(ng2),but we only modify (ng1) – J. Allen May 14 '20 at 01:52
  • See if the config listed in this article helps? https://medium.com/@gdurelle/gitlab-behind-a-reverse-proxy-nginx-5245476747fe – Tarun Lalwani May 14 '20 at 05:20
  • it seems to modify Gitlab in https://medium.com/@gdurelle/gitlab-behind-a-reverse-proxy-nginx-5245476747fe – J. Allen May 14 '20 at 06:48

1 Answers1

0

need nginx reverse proxy /servername/port/ for dynamic servername and port

I find resolve (dns server + nginx) Using nginx regex location matching to dynamically map URI's to different ports for multiple reverse proxies

J. Allen
  • 11
  • 4