按
Gitlab:Ningx =>Inserting custom settings into the NGINX config
編輯您的gitlab的/etc/gitlab/gitlab.rb:
nano /etc/gitlab/gitlab.rb
和sroll nginx的[ 'custom_nginx_config']和如下修改使確定取消註釋
# Example: include a directory to scan for additional config files
nginx['custom_nginx_config'] = "include /etc/nginx/conf.d/*.conf;"
創建新配置目錄:
mkdir -p /etc/nginx/conf.d/
nano /etc/nginx/conf.d/new_app.conf
和內容添加到您的新的配置
# my new app config : /etc/nginx/conf.d/new_app.conf
# set location of new app
upstream new_app {
server localhost:1234; # wherever it might be
}
# set the new app server
server {
listen *:80;
server_name new_app.mycompany.com;
server_tokens off;
access_log /var/log/new_app_access.log;
error_log /var/log/new_app_error.log;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
location/{ proxy_pass http://new_app; }
}
,並重新配置gitlab
獲得新設置插入
gitlab-ctl reconfigure
,並重新啓動nginx
gitlab-ctl restart nginx
您的新應用程序應該可以訪問。
PS:檢查nginx
錯誤日誌:
tail -f /var/log/gitlab/nginx/error.log
GItLab配備了一個自己的nginx的。你可以簡單地安裝另一個nginx或apache並運行你的網站。但是你必須指定端口和代理。 – talaub
爲什麼不設置另一個虛擬機?就性能或配置管理而言,這確實不是一個好主意。如果你真的想,你需要看看自定義NGINX配置添加不同的路由/虛擬主機。 –
這就是我的問題。我沒有找到任何nginx配置。我也嘗試安裝Apache,但我無法運行該服務。 – DS87