【问题标题】:NginX Server block on GitLab is ignoredGitLab 上的 NginX 服务器块被忽略
【发布时间】:2017-05-25 16:40:56
【问题描述】:

我在 Microsoft Azure 中的虚拟机上安装了 GitLab,其中我还有一个 Apache2 Web 服务器,它应该响应一些静态网站。

由于 GitLab 有一个嵌入式 NGinX Web 服务器,我认为只需进行以下两项更改就足够了:

  • 让 apache 监听另一个端口而不是 80(我改成 8090)
  • 向 GitLab 的 NGinX 添加一个服务器块(首先将此配置添加到 gitlab.rb nginx['custom_nginx_config'] = "include /etc/nginx/conf.d/*.conf;",然后在 /etc/nginx/conf.d/serverblock.conf 中创建以下块)

    服务器{ 根 /var/www/; server_name .notgitlabdomain.com;

      access_log /etc/nginx/logs/notgitlabdomain_access.log;
      error_log /etc/nginx/logs/notgitlabdomain_error.log;
    
      location / {
            proxy_set_header X-Real-IP  $remote_addr;
            proxy_set_header X-Forwarded-For $remote_addr;
            proxy_set_header Host $host;
            proxy_pass 127.0.0.1:8090;
            add_header  X-Upstream  $upstream_addr;
            add_header NLC_S "s";
      }
    

    }

问题是到目前为止这不起作用。我打开并检查了 nginx.conf(在 /var/opt/gitlab/nginx/conf/ 中)文件是否实际上正在读取我添加的服务器块,并且确实如此。但是当我点击我的 notgitlabdomain.com 域中的链接时,它会将我重定向到 notgitlabdomain.com/users/sign_in 并出现无法导入某些 css 文件的 Sass 错误。

【问题讨论】:

    标签: apache ubuntu nginx gitlab


    【解决方案1】:

    打开开发工具并检查请求。

    我猜这个问题与 gitlab (domain url) 的配置有关

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2022-01-24
      • 2012-07-10
      • 2013-07-20
      • 1970-01-01
      • 2019-12-11
      • 1970-01-01
      • 1970-01-01
      • 2020-04-04
      相关资源
      最近更新 更多