2016-12-14 31 views
0

我正在使用omnibus包託管一個gitlab服務器。
的網址是一樣的東西http://myurl.com/gitlab
我需要/想添加一個重定向到如此:Gitlab Ngix重定向到其他服務器/頁面

http:/myurl.com/jsp 

會重定向到Tomcat服務器我在本地網絡上。

谷歌告訴我,我可以通過使用自定義nginx字符串/ confs並寫一個serverblock或類似的東西來做到這一點。 (其他想法也歡迎:))

你的配置是什麼?

+0

Tomcat和Gitlab的關係如何? – Justas

回答

0

你應該能夠爲/jsp(類似於this article)添加規則到nginx的配置文件中的現有server部分:

location /jsp { 
     proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; 
     proxy_set_header Host $http_host; 
     proxy_set_header X-Forwarded-Proto https; 
     proxy_redirect off; 
     proxy_connect_timeout  240; 
     proxy_send_timeout   240; 
     proxy_read_timeout   240; 
     # note, there is not SSL here! plain HTTP is used 
     proxy_pass http://tomcat_server; 
    } 
0

我會在前插入一個反向代理您的Gitlab實例,以確保您的意圖能夠存活代碼更新。這可以是NGINX,Apache或HAProxy。

相關問題