ÔõÑùÐÞ¸ÄGitLabµÄHTTP»òHTTPS¶Ë¿Ú
gitlabÊÇÒ»¸ö¿ªÔ´µÄ´úÂëÍйÜƽ̨£¬Í¨³£Ä¬ÈÏʹÓÃhttpÐÒé¼àÌý80¶Ë¿Ú¡£¿ÉÊÇ£¬ÓÐЩÇéÐÎÏÂÐèÒª½«gitlab°²Åŵ½²î±ðµÄ¶Ë¿Ú£¬±¾ÎĽ«ÏÈÈÝÔõÑùÐÞ¸ÄgitlabµÄhttp»òhttps¶Ë¿Ú¡£
ÐÞ¸ÄHTTP¶Ë¿Ú
Ê×ÏÈ£¬½øÈëGitLabЧÀÍÆ÷µÄ¿ØÖÆ̨£¬Ö´ÐÐÒÔÏÂÏÂÁ
sudo vim /etc/gitlab/gitlab.rb
µÇ¼ºó¸´ÖÆ µÇ¼ºó¸´ÖÆ
±à¼Æ÷»á·¿ªGitLabµÄÉèÖÃÎļþ£¬ÕÒµ½ÒÔÏÂÐУº
external_url 'http://example.com'
µÇ¼ºó¸´ÖÆ
½«ÆäÐÞ¸ÄΪ£º
external_url 'http://example.com:8080'
µÇ¼ºó¸´ÖÆ
ÉúÑÄÐ޸ģ¬È»ºóÖ´ÐÐÒÔÏÂÏÂÁîʹÉèÖÃÎļþÉúЧ£º
sudo gitlab-ctl reconfigure
µÇ¼ºó¸´ÖÆ µÇ¼ºó¸´ÖÆ
GitLab½«ÖØмÓÔØÉèÖÃÎļþ²¢Æô¶¯Ð§ÀÍ¡£ÏÖÔÚ£¬Äã¿ÉÒÔͨ¹ý»á¼ûhttp://example.com:8080À´»á¼ûGitLabÁË¡£
ÐÞ¸ÄHTTPS¶Ë¿Ú
ÈôÊÇÄãµÄGitLabʹÓÃHTTPSÐÒé¼àÌý443¶Ë¿Ú£¬ÐèÒª×öһЩÌØÁíÍâÊÂÇéÀ´ÐÞ¸ÄHTTPS¶Ë¿Ú¡£Ê×ÏÈ£¬È·±£ÄãÒѾÉèÖÃÁËSSLÖ¤Ê飬²»È»Çë²Î¿¼¹Ù·½Îĵµ¾ÙÐÐÉèÖá£
½ÓÏÂÀ´£¬½øÈëGitLabЧÀÍÆ÷µÄ¿ØÖÆ̨£¬Ö´ÐÐÒÔÏÂÏÂÁ
sudo vim /etc/gitlab/gitlab.rb
µÇ¼ºó¸´ÖÆ µÇ¼ºó¸´ÖÆ
±à¼Æ÷»á·¿ªGitLabµÄÉèÖÃÎļþ£¬ÕÒµ½ÒÔÏÂÐУº
nginx['ssl_certificate'] = "/etc/gitlab/ssl/server.crt" nginx['ssl_certificate_key'] = "/etc/gitlab/ssl/server.key"
µÇ¼ºó¸´ÖÆ
½«ËüÃÇÐÞ¸ÄΪ£º
nginx['ssl_certificate'] = "/etc/gitlab/ssl/server.crt" nginx['ssl_certificate_key'] = "/etc/gitlab/ssl/server.key" nginx['listen_port'] = 8443 nginx['listen_https'] = true
µÇ¼ºó¸´ÖÆ
ÉúÑÄÐ޸ģ¬È»ºóÖ´ÐÐÒÔÏÂÏÂÁîʹÉèÖÃÎļþÉúЧ£º
sudo gitlab-ctl reconfigure
µÇ¼ºó¸´ÖÆ µÇ¼ºó¸´ÖÆ
ÏÖÔÚ£¬GitLab½«Ê¹ÓÃHTTPSÐÒé¼àÌý8443¶Ë¿Ú¡£Äã¿ÉÒÔͨ¹ý»á¼ûhttps://example.com:8443À´»á¼ûGitLabÁË¡£
×ܽá
ͨ¹ýÐÞ¸ÄGitLabÉèÖÃÎļþµÄexternal_urlºÍnginxÑ¡ÏÄã¿ÉÒÔºÜÈÝÒ×µØÐÞ¸ÄGitLabµÄHTTP»òHTTPS¶Ë¿Ú¡£ÐèҪעÖصÄÊÇ£¬ÔÚÐÞ¸ÄHTTPS¶Ë¿Ú֮ǰҪȷ±£ÒѾÉèÖÃÁËSSLÖ¤Êé¡£
ÒÔÉϾÍÊÇÔõÑùÐÞ¸ÄGitLabµÄHTTP»òHTTPS¶Ë¿ÚµÄÏêϸÄÚÈÝ£¬¸ü¶àÇë¹Ø×¢±¾ÍøÄÚÆäËüÏà¹ØÎÄÕ£¡