【发布时间】:2016-09-26 22:18:25
【问题描述】:
我正在尝试在使用 Ubuntu 安装 GitLab 的同一台服务器上托管其他应用程序。根据对GitLab's documentation 的一些搜索,我发现您可以启用自定义.conf 文件并将它们定向到它们通常应该位于/etc/nginx/conf.d/ 路径中的位置。参考资料说要将它们放在指定的路径中,但我在/etc 中缺少 nginx 文件夹。不确定它是否打算不安装在 /etc 中,但是为什么这个参考资料说 nginx 应该在那里?
更新 1:
根据@bradrini 的回复,我已经设法使用名为example.conf 的配置文件在/etc/nginx/conf.d 中创建了目录。我设置的域结构是在 dev.example.com 上有 GitLab,并将这个其他应用程序指向 test.example.com。下面是我对这个新域的 nginx 配置:
server {
# Using my actual IP here which houses GitLab and my test.example.com domain
listen 111.111.111.11:443 default_server ssl;
# What the domain will be called
server_name test.example.com;
# Wildcard cert used for GitLab
ssl_certificate /etc/gitlab/ssl/dev.example.com.crt
# Wildcard key used for GitLab
ssl_certificate_key /etc/gitlab/ssl/dev.example.com.key
#charset koi8-r;
#access_log /var/log/nginx/log/host.access.log main;
location / {
# Root file directory for the test.example.com domain
root /var/www/test.example.com/html;
index index.html index.htm;
}
}
我现在无法连接到我的 test.example.com 域,这很好,因为它最初转发到我的 GitLab 域 (dev.example.com)。
我现在认为问题是由 nginx 配置问题引起的?还有什么我可能错过的我应该检查的吗?我需要担心任何sites-enabled 或sites-available 文件夹吗?
更新 2:
因此,使用上面的配置,我的 dev.example.com 或 test.example.com 都不会主动运行。他们都无法根据我的浏览器连接。不知道是什么让他们两个都无法连接。
【问题讨论】:
标签: ubuntu nginx gitlab gitlab-omnibus