Forum

Gitlab + HTTPS (ngi...
 
Notifications
Clear all

Gitlab + HTTPS (nginx only)

2 Posty
1 Users
0 Reactions
494 Widok
0
Topic starter

how to use https when gitlab is using different port for gitlab http://mygitlab.local:88

env: gitlab nginx + secondary nginx for my websites

2 Answers
0
Topic starter

env: running gitlab.mydomain.com:88 and second nginx on mydomain.com

  1. touch /etc/ngnix/sites-enabled/myGitlab
  2. content of /etc/ngnix/sites-enabled/myGitlab
    server {  
    	listen 80;
    	servername gitlab.mydomain.com
    
    	location / {
    		proxy_pass  http://gitlab.mydomain.com:88 
    	}
    }
  3. then type:
    certbot --nginx
  4. install certificate for gitlab.mydomain.com
  5. edit nano /etc/gitlab/gitlab.rb
  6. set external_url to gitlab:mydomain.com without port
    external_url 'http://gitlab.mydomain.com'
  7. set nginx['listen_port'] to 88
    nginx['listen_port'] = 88
  8. then type gitlab-ctl reconfigure
  9. then type gitlab-ctl restart nginx
  10. https://gitlab.mydomain.com is now working :)
  11. ekhem, dont forget about runners regression (read below)
  12. ekhem 2, dont forget about SPF record! (must be sepearted for each domain). Example for/etc/bind/zones/mydomain.file
    @       IN      TXT     "v=spf1 a mx include:_spf.google.com ~all"
    gitlab  IN      TXT     "v=spf1 a mx include:_spf.google.com ~all"
    

 

0
Topic starter

RUNNERS!

this config may break all your runners.

example errors 

api/v4/jobs/request: 404 Not Found
api/v4/runners/verify: 401 Unauthorized
  1. edit /etc/gitlab-runner/config.toml
  2. change url= to  https://gitlab.mydomain.com
  3. add clone_url= and set http://giblat.mydomain.com:88  
  4. verify token

 

Odpowiedź

Author Name

Author Email

Your question *

 
Preview 0 Revisions Saved
Share: