I have one public static IP address and several applications running on port 80 and 443 on their own virtual machines.
One of them is GitLab.
As I can't forward ports 80/443 to just one of them, I have:
- An Ubuntu machine receiving all 80/443 requests.
nginx
is installed on it and configured as proxy server based on host header so for instancescm.mydomain.com
is configured toproxy_pass 192.168.50.200
which is the GitLab machine.
So far everything is working as expected.
My challenges is how to enable https
support for GitLab. I know when I edit the external_url
to https://....
GitLab takes care of the rest, but that's where the problem starts because now I have to forward port 443 in my proxy server not 80, and without a valid certificate that's not possible, and a valid certificate for scm.mydomain.com
is already installed on the GitLab machine.
Is there a solution?
Here's my nginx
config for port 80 which is working:
server {
listen 80;
server_name scm.mydomain.com;
location / {
include proxy_params;
proxy_pass http://192.168.50.200;
}
}