按
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