Gitlab with port forwarding and reverse proxy

Hi everyone,

I would like to know if there is any documentation that refers to how to configure gitlab installed on a server present in the local network with a local IP address and accessible from the internet through port forwarding and or a reverse proxy like nginx

I hope for some help at least on the documentation where it is possible to find it

Hi,

You can find plenty of examples using a search engine - I believe search engines are still working that would help you find such information - did you actually try searching? For example is explained in this section: NGINX settings | GitLab

You can also check out the remainder of the Gitlab documentation here: Installation methods | GitLab which pretty much explains everything that you would want to do with installing and configuring Gitlab, as well as behind a reverse proxy.

1 Like

On nginx I found it but I also wanted to do port forwarding but I suppose this is not suitable as a topic here because port forwarding is at router level and not application level; more than anything I wanted to know about port forwarding if there is something to set in the configuration file before going to make changes on the router. Ok thanks for the reply

Port forwarding can be done, but if you are not configuring Gitlab for HTTPS port 443, then you’ll need to configure appropriately as per the link for nginx reverse proxy to ensure HTTPS → HTTP works properly. As for the other ports, for SSH or whatever, port forwarding will work for that fine.

Other than the specific bit in gitlab config for what I mentioned already for HTTPS → HTTP, there isn’t anything else you need to configure differently. The remainder of port forwarding is standard and done like you would normally on the router.

1 Like

Ok so I configure gitlab in http, then nginx and apply the certificate and finally I apply port forwarding on the router

make sure your Nginx reverse proxy is correctly set up for handling HTTPS traffic, configure port forwarding on your router for the relevant ports (e.g., 443 for HTTPS, 22 for SSH), and ensure that GitLab’s configuration aligns with these settings. I also recommend buy proxies to keep the uploading of data invisible to other people’s eyes. Regular port forwarding for other services is done as usual. Always consider security best practices when exposing services to the internet, especially when dealing with sensitive information like code repositories.