簡體   English   中英

GitLab上的NginX Server塊被忽略

[英]NginX Server block on GitLab is ignored

我已經在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)

    服務器{root / 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域中的鏈接時,它會因無法導入某些CSS文件的Sass錯誤而將我重定向到notgitlabdomain.com/users/sign_in。

打開開發工具並檢查請求。

我想這個問題與gitlab(網域網址)的配置有關

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM