使用gitlab的nginx的服务另一个应用程序 [英] Using gitlab's nginx to serve another app

查看:163
本文介绍了使用gitlab的nginx的服务另一个应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好我已经使用这个结果安装Gitlab
<一href=\"https://gitlab.com/gitlab-org/omnibus-gitlab/blob/master/README.md#installation\">https://gitlab.com/gitlab-org/omnibus-gitlab/blob/master/README.md#installation

Hello I have installed Gitlab using this
https://gitlab.com/gitlab-org/omnibus-gitlab/blob/master/README.md#installation

现在我想使用nginx的服务比gitlab应用程序之外的其他内容
我怎么能做到这一点。

Now I want to use nginx to serve another content other than gitlab application how can I do this


  • 在哪里,我需要的配置文件来修改

  • 我如何可以指向一个目录如/无功/网络,这样的nginx知道是另一个应用程序的根目录。

更新(忘了提,我在红帽6.5运行此)

Update(forgot to mention I'm running this under Red Hat 6.5)

推荐答案

vndr的上述方案的工作,但在https://gitlab.com/gitlab-org/omnibus-gitlab/blob/master/doc/settings/nginx.md,它说:

vndr's above solution would work but on the https://gitlab.com/gitlab-org/omnibus-gitlab/blob/master/doc/settings/nginx.md, it said:

插入自定义设置成NGINX配置

Inserting custom settings into the NGINX config

如果您需要添加自定义设置成NGINX配置,例如
  包括现有的服务器模块,可以使用以下设置。

If you need to add custom settings into the NGINX config, for example to include existing server blocks, you can use the following setting.

因此​​,让我们检查/opt/gitlab/embedded/cookbooks/gitlab/templates/default/nginx.conf.erb,看它是否包含为&LT;%= @custom_nginx_config%>
(它看起来像当前gitlab-7.5.3_omnibus.5.2.1.ci-1.el6.x86_64.rpm不包括它)

So let's check your /opt/gitlab/embedded/cookbooks/gitlab/templates/default/nginx.conf.erb to see if it contains: <%= @custom_nginx_config %> (it looks like the current gitlab-7.5.3_omnibus.5.2.1.ci-1.el6.x86_64.rpm doesn't include it)

如果没有,则只是将它加入线之上包含&LT;%= @gitlab_http_config%>; 这样的:

If not, then just add it above the line include <%= @gitlab_http_config %>; like:

<%= @custom_nginx_config %>
include <%= @gitlab_http_config %>;

然后打开/etc/gitlab/gitlab.rb补充:
nginx的['custom_nginx_config'] =包括/etc/nginx/conf.d / * CONF。

Then open the /etc/gitlab/gitlab.rb to add: nginx['custom_nginx_config'] = "include /etc/nginx/conf.d/*.conf;"

我们可以只添加使它简单:包含/etc/nginx/conf.d / * CONF; 代替的&LT;%= @custom_nginx_config%>

We can make it simply by just add: include /etc/nginx/conf.d/*.conf; instead <%= @custom_nginx_config %>

然后创建/etc/nginx/conf.d/和gitlab-CTL重新配置正常nginx的conf文件

Then create normal nginx .conf files in /etc/nginx/conf.d/ and gitlab-ctl reconfigure

这篇关于使用gitlab的nginx的服务另一个应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆