-2

Current scenario

I have an Apache server running on default port 80 on a CentOS 6.7 box. I forward port 80 from my router to this machine, and I can access it from the outside with my domain a.com. Everything works as expected.

What I want to do

I stood up a second machine, CentOS 7, to act as a dedicated GitLab server. By default, it runs the web interface through nginx on port 80. I want to be able to access it through my subdomain gitlab.a.com.


Is this possible to do? And if so, am I on the right track thinking it can be done with some combination of using a virtual host and a reverse proxy in Apache? I'd prefer both of them to run on 80 if possible and not use alternate ports.

istrasci
  • 97
  • 5

1 Answers1

1

Yes, that is exactly what you can do.

  1. You make an A record for gitlab.a.com pointing to the same IP address as a.com in your DNS.

  2. You make a virtual host for gitlab.a.com in your a.com Apache server, which contains the reverse proxy directives sending all traffic for this domain to your CentOS 7 box.

Tero Kilkanen
  • 36,796
  • 3
  • 41
  • 63