
Centos-stream-9 VM 上で gitlab-ce を実行し、別の ubuntu VM 上で nginx を実行して、gitlab インスタンスへのリバース プロキシとして動作しています。しかし、何らかの理由で動作しません。nginx が 502 Bad Gateway を返しています。
nginxを実行しているサーバーは192.168.0.71、gitlabは192.168.0.148です。
続くこのウォークスルーgitlabのウェブサイトで、gitlab.rbを次のように更新しました。
gitlab_rails['trusted_proxies'] = ['192.168.0.1/24', '192.168.0.71']
nginx['enable'] = false
nginx['redirect_http_to_https'] = false
nginx['listen_port'] = 8084
nginx['listen_https'] = false
私のnginx設定にはこれが含まれています
server {
listen 83;
listen [::]:83;
location / {
proxy_pass http://192.168.0.148:8084;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
}