0

Dived into the joys of using apache as a proxy. Awesome. There is a learning curve to deal with but the payoff is well worth it!

I took the virtual host approach to benefit from having the same urls whether I access locally or externally. Everything is setup, apache mod_proxy is listening on port 443, redirecting all gitlab.mydomain traffic to lan based lamp stack and all is swell except when I hit the front page, after being redirected http://gitlab.mydomain/users/sign_in. I have to retype the https in the url manually and then all is well. Ditto when I post a comment on the projects page. For the login problem the application (gitlab) seems to redirect anonymous non-logged in users to http://gitlab.mydomain.com instead of the expected https://gitlab.mydomain.com.

I probably will have to dive into code tomorrow and see if it is at application level ie maybe a $base_url variable of some sort like in Drupal. Here is the vhost file, maybe I missed or broke something in there, any tips welcome.

############################################################
#
#  proxy related directives
#
###########################################################
#NameVirtualHost gitlab.mydomain.com:443
<VirtualHost *:443>
  ServerName gitlab.mydomain.com
  ProxyRequests off
  LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-agent}i\"" combined
  CustomLog logs/gitlab_log combined
  LogLevel info

  SSLProxyEngine On
  <Proxy *>
    Order deny,allow
    Allow from all
  </Proxy>
  SSLEngine on
  SSLProtocol all
  SSLCertificateFile /etc/pki/tls/certs/localhost.crt
  SSLCertificateKeyFile /etc/pki/tls/private/localhost.key

 # SSLProtocol all -SSLv2
 # SSLCipherSuite ALL:!ADH:!EXPORT:!SSLv2:RC4+RSA:+HIGH:+MEDIUM:+LOW

  ProxyPass / https://gitlab.mydomain.com/
  ProxyPassReverse / https://gitlab.mydomain.com/
</VirtualHost>
  • Just saw that NameVirtualHost is commented?!? is this not needed? Whatever, things are 95% working but the signup page is kind of annoying.

  • Can someone with enough rep to edit tags please add gitlab tag to post?

11
  • Are you really proxying that virtual host to itself?! Mar 1, 2013 at 7:21
  • @Michael - I have alcatraz.mydomain.com proxying to gitlab.mydomain.com. Is something off in there? I truly could have misconfigured as I am simply a php developper and don't play so much with proxies all that much unless I really really have to! =) Mar 1, 2013 at 7:28
  • 1
    ServerName gitlab.mydomain.com ... ProxyPass / https://gitlab.mydomain.com/ ... I don't think that's going to work. Mar 1, 2013 at 7:44
  • I may be wrong, but I don't see any redirect happening there at all. If it's the gitlab application that issues the redirect, it'd probably be more useful to post that config.
    – Jenny D
    Mar 1, 2013 at 9:12
  • 1
    Yes, but that example doesn't proxy to itself. Mar 1, 2013 at 22:39

1 Answer 1

0

The isssue turned out to be resolved application side. In gitlab configuration files one needs to indicate protocol is https.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .