简体   繁体   English

使用SSL通过Apache配置Gitlab

[英]Configuring Gitlab through Apache with SSL

i want to use GitLab through apache with ssl. 我想通过apache和ssl一起使用GitLab。 I followed this guide but i still get a 503 Service Unavailable message. 我按照指南,但仍然收到503 Service Unavailable消息。

I have installed GitLab as described in the instruction from GitLab. 按照 GitLab的说明安装了GitLab。

My gitlab.rb configuration looks like the file in the guide: 我的gitlab.rb配置看起来像指南中的文件:

external_url 'https://domain:4443' nginx['ssl_certificate'] = "/etc/gitlab/tls/SignedCertificateBundle.crt" nginx['ssl_certificate_key'] = "/etc/gitlab/tls/SignedCertificate.key"

My virtual host: 我的虚拟主机:

<VirtualHost *:443>
    ServerName domain
    ServerAlias domain

    Header always set Strict-Transport-Security "max-age=31536000; includeSubdomains;"
    SSLEngine on
    SSLCertificateFile      /etc/gitlab/tls/SignedCertificate.crt
    SSLCertificateKeyFile   /etc/gitlab/tls/SignedCertificate.key
    SSLCACertificateFile    /etc/gitlab/tls/IntermediateCertificate.crt
    SSLCipherSuite          ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384

    <Proxy *>
            Order deny,allow
            Allow from all
    </Proxy>

    SSLProxyEngine on
    ProxyRequests Off
    ProxyPass / https://domain:4443/
    ProxyPassReverse / https://domain/

    Header edit Location ^http://domain/ https://domain/
    RequestHeader set X-Forwarded-Proto "https"

</VirtualHost>

Did i forget something? 我忘记了什么吗?

i found a solution for my problem (maybe others struggling with the same thing) 我为我的问题找到了一个解决方案(也许其他人在同样的事情上挣扎)

My gitlab.rb config file: 我的gitlab.rb配置文件:

external_url 'https://domain'
nginx['listen_address'] = 'localhost'
nginx['listen_port'] = 8888
nginx['listen_https'] = false

And my virtual host: 我的虚拟主机:

<VirtualHost *:443>
    ServerName domain
    ServerAlias domain
    ServerAdmin mail

    RequestHeader set Host "domain"
    RequestHeader add X-Forwarded-Ssl on
    RequestHeader set X-Forwarded-Proto "https"

    ProxyPreserveHost On
    ProxyPass / http://localhost:8888/
    ProxyPassReverse / http://localhost:8888/

    SSLEngine on
    SSLCertificateFile      /etc/gitlab/tls/SignedCertificate.crt
    SSLCertificateKeyFile   /etc/gitlab/tls/SignedCertificate.key
    SSLCACertificateFile    /etc/gitlab/tls/IntermediateCertificate.crt
    SSLCipherSuite          ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384
</VirtualHost>

For me GitLab is now working with TLS over apache 对我来说,GitLab正在使用TLS而不是apache

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM