やりたいこと:ApacheとGitlab-ctlをStartして両方のトップページを表示したい。
VirtualHostを使用してApacheからNginx→Gitlabと設定したつもりが
GitlabのURLにアクセスすると503エラーになります。
Gitlabのstatusを確認したところ以下のようになっており、これが原因の一つかもしれないと考えましたがどうなのでしょうか?
down: alertmanager: 0s, normally up, want up; run: log: (pid 1800) 95707s
down: gitaly: 1s, normally up, want up; run: log: (pid 1789) 95708s
run: gitlab-exporter: (pid 1245032) 36s; run: log: (pid 1809) 95707s
run: gitlab-kas: (pid 1245040) 36s; run: log: (pid 1796) 95707s
run: gitlab-workhorse: (pid 1245058) 35s; run: log: (pid 1803) 95707s
run: logrotate: (pid 1245073) 35s; run: log: (pid 1791) 95707s
run: node-exporter: (pid 1245087) 35s; run: log: (pid 1811) 95707s
run: postgres-exporter: (pid 1245099) 34s; run: log: (pid 1817) 95707s
run: postgresql: (pid 1245115) 34s; run: log: (pid 1793) 95707s
run: prometheus: (pid 1245124) 33s; run: log: (pid 1805) 95707s
run: puma: (pid 1245573) 5s; run: log: (pid 1807) 95707s
run: redis: (pid 1245154) 33s; run: log: (pid 1812) 95707s
run: redis-exporter: (pid 1245167) 32s; run: log: (pid 1798) 95707s
run: sidekiq: (pid 1245182) 32s; run: log: (pid 1813) 95707s
VirtualHostなどの設定は下記のようになっております。
実行環境:
Apache 2.4.37
GitLab 15.11.0
CentOS
Apacheにはポート80をListenしています。
このままGitlabをstartさせると競合するため、VirtualHostをhttpd設定ファイルに記述しており、Gitlabのeternal_urlにhttp://IPアドレス/gitlabと設定しています。
listen 80
<VirtualHost *:80>
ServerName [IPアドレス]
ProxyPreserveHost On
ProxyPass /gitlab http://localhost:8080/gitlab
ProxyPassReverse /gitlab http://localhost:8080/gitlab
RewriteEngine on
RewriteCond %{REQUEST_URI} ^/assets/
RewriteRule .* - [L]
ProxyRequests Off
ProxyVia Off
<Proxy *>
Require all granted
</Proxy>
</VirtualHost>
nginxの記述
server {
listen 8080;
server_name IPアドレス;
location /gitlab {
proxy_pass http://localhost:7000/gitlab;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
location / {
proxy_pass http://localhost:7000;
proxy_set_header Host $host;
}
}
eternal_url
http://IPアドレス:7000/gitlab
以上です、不足している情報がありましたらご教示頂けると助かります。