【官方】修改gitlab nginx的端口

这两天装上gitlab,由于某些情况需要修改默认的web端口,原端口为80

但是我百度了下发现百度真的很烂!没啥有用的教程或者链接,找到了几个csdn的博客,结果说的含糊其词,

还有的吧其他服务的端口也改了。。。

我只是想修改nginx端口而已。。。

看了gitlab.rb文件,找到了这句话

这句话可以看出来默认端口没有设置,nginx就会默认占用80,直接修改这句话,一定记得吧前面的#去掉,然后运行

 

=================官方指导文档=================

 https://gitlab.com/gitlab-org/omnibus-gitlab/blob/master/doc/settings/nginx.md

是gitlab的官方指导文档,这才是权威的!

#设置默认监听IP地址

Setting the NGINX listen address or addresses

By default NGINX will accept incoming connections on all local IPv4 addresses. You can change the list of addresses in /etc/gitlab/gitlab.rb.

#设置监听端口

Setting the NGINX listen port

By default NGINX will listen on the port specified in external_url or implicitly use the right port (80 for HTTP, 443 for HTTPS). If you are running GitLab behind a reverse proxy, you may want to override the listen port to something else. For example, to use port 8080:

#设置代理ssl

Supporting proxied SSL

By default NGINX will auto-detect whether to use SSL if external_url contains https://. If you are running GitLab behind a reverse proxy, you may wish to terminate SSL at another proxy server or load balancer. To do this, be sure the external_url contains https:// and apply the following configuration to gitlab.rb:

Note that you may need to configure your reverse proxy or load balancer to forward certain headers (e.g. Host, X-Forwarded-Ssl, X-Forwarded-For, X-Forwarded-Port) to GitLab. You may see improper redirections or errors (e.g. “422 Unprocessable Entity”, “Can’t verify CSRF token authenticity”) if you forget this step. For more information, see:

发表评论

邮箱地址不会被公开。 必填项已用*标注