TurnKey Linux Virtual Appliance Library

GitLab HTTP Port

Hi there, loving TKL - I use several of your applications!

Having a slight issue with my latest endeavour though and was hoping somebody could help;

I'm running gitlab in a Hyper-V instance of server 2012 which already has an IIS server setup serving websites on port 80 and I have no idea where to even start on using IIS to deliver the pages from the gitlab instance so what I decided to do instead was change the listen port of gitlab.

I found a tutorial here (I forget where, exactly - it came around from a fair amount of google-fu) on how to change the port the webserver listens too.. I think it was nginx and unicorn? Anyway, that seemed to work perfectly, I could no longer connect to http://192.168.1.59 but instead http://192.168.1.59:88 connected... and then the problems began. gitlab obviously uses page redirects such as redirecting to the login page when you connect, problem is it's not redirecting to the new port - it's trying to redirect to the standard http port (http://192.168.1.59/user/login or something to that effect).

So my question to you guys is this; is it possible, and if so, how would I go about telling gitlab it's got a new home on port 88?

 

Cheers in advance,

Cal

Are you hosting GitLab in

Are you hosting GitLab in IIS? If so, why do you need to use a different port? Port 80 should work just fine. Maybe I'm just not understanding.

As far as I know you can't

As far as I know you can't host gitlab in a Windows IIS environment? What I mean is I have IIS running hosting other websites so port 80 is forwarded to the IIS Server.

I'm running gitlab appliance in Hyper-V so to make it accessible externally I need to change the port that it uses so I can forward that port to gitlab. I've successfully gotten the web server in the appliance listening on port 88 but when I connect to it, gitlab redirects to addresses on port 80 which ofcourse it won't find anything on as the web server is listening on port 88

Eric (tssgery)'s picture

Let me see if I understand this

Let me see if I understand what you want to do before I answer.

  • The hyper-v server runs IIS and serves pages on port 80.
  • The gitlab TKL applaince runs in Hyper-V and is configured with a an "Internal" network (meaning the gitlab instance does not have a serpately addresible ip address from outsside the hyper-v instance).
  • You want to modify the port gitlab listens on so as to not conflict with the IIS server.
  • you want users of gitlab to be able to access gitlab with http://<ipadderssofhypervserver>:88

That all correct? If so... can I ask if you're able to put the gitlab instance on an "external" network within hyper-v? That would make things a lot easier.


IIS is running on the

IIS is running on the physical server which also hosts the Hyper-V instance.

The Hyper-V Instance is linked to my physical LAN through a Hyper-V Virtual switch, it is essentially another machine on my LAN so I can forward the ports and allow external (internet) access to it.

I do want to modify the port which gitlab uses and I would like gitlab to be accessible through port 88.

Thanks for your help :)

Eric (tssgery)'s picture

But...

if your gitlab appears as a seperate machine on your network, there is no conflict with the IIS server. You don't need forwarding at all.

It's one thing to want to change the port, and it'd be nice to know how to do that. But... you don;t need to if there is no conflict.

 

Maybe I'm missing something?


I need to forward the port so

I need to forward the port so it is accessible from the internet. I only have 1 internet IP address but several servers provide internet services - this is why I use port forwarding.

For example:

say my Internet IP is 10.0.01, I need multiple services to be accessible through this one IP that are hosted on multiple servers, to acheive this I forward ports as needed;

IIS - 192.168.1.16 => port 80 forwarded so 10.0.0.1:80 routes to 192.168.1.16:80 internally
FTP - 192.168.1.21 => port 21 forwarded so 10.0.0.1:21 routes to 192.168.1.21:21 internally

RDP - 192.168.1.17 => port 3389 forwarded so 10.0.0.1:3389 routes to 192.168.1.17:3389 internally

so for gitlab I would need to forward a new port to the server as such

git - 192.168.1.56 => port 88 forwarded so 10.0.0.1:88 routes to 192.168.1.16:88 internally

the objective being that I can open a browser and go to http://mydomain.com to reach my web server and http://mydomain.com:88/ to reach my gitlab server.

 

I hope this makes sense, thanks again for the help! Much appreciated

Jeremy's picture

Why not just redirect the port?

Most routers allow you to redirect external ports to internal ones. Just set it up to redirect external port 88 to internal port 80 on your GitLab appliance.

Hey, I tried this yesterday

Hey, I tried this yesterday but it didn't work - I can't remember the exact error so I will attempt it again tomorrow and see if I can get more information. Thanks :)

Hi guys, thanks for all your

Hi guys, thanks for all your help - I couldn't get the port forwarding to work so I worked out how to use IIS as a Reverse Proxy which is now working fine.

 

Thanks again!

Port change in /etc/nginx/sites-enabled/gitlab not enougth

Hi,

i changed the Port in the nginx config file and it partially work. The problem is that there are a lot of redirections with full (wrong) specified URL such as http://server/admin/login or http://server/info/resque/overview and in this redirections the port is missing. In the WebBrowser I have to add the port in the URL and then it works until the next redirection is received from the server.

It would be perfect if the redirections doesn't contain the server information. Or can i configure this in an other place?

Regards,
Bernhard

Jeremy's picture

TBH I know very little about Nginx

And what you read above is about the limit of my knowledge of GitLab. So my suggestion would be to post on the GitLab forums/mailing list.

ngnix proxy configuration also needs a change

apart from the standart site config listen port change

at /etc/nginx/include/gitlab-proxy

add the port to:

proxy_set_header Host $host:server_port;

Hope it helps.

Post new comment

The content of this field is kept private and will not be shown publicly. If you have a Gravatar account, used to display your avatar.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <p> <span> <div> <h1> <h2> <h3> <h4> <h5> <h6> <img> <map> <area> <hr> <br> <br /> <ul> <ol> <li> <dl> <dt> <dd> <table> <tr> <td> <em> <b> <u> <i> <strong> <font> <del> <ins> <sub> <sup> <quote> <blockquote> <pre> <address> <code> <cite> <strike> <caption>

More information about formatting options

Leave this field empty. It's part of a security mechanism.
(Dear spammers: moderators are notified of all new posts. Spam is deleted immediately)