nginx site adds IP address, breaks gitlab 5.0
Created by: sethvargo
On a fresh installation, following the newest guide, the nginx site template for gitlab has this:
server {
listen YOUR_SERVER_IP:80 default_server; # e.g., listen 192.168.1.1:80;
# ...
}
If you actually put your server IP there, nginx will return 502s all day from any request made on your local machine if you have your hostname in the /etc/hosts
file. That's because the request is going to 127.0.0.1
, since it never leaves the local machine.
Since gitlab-shell uses the internal API, it fails. Removing the IP altogether and just listening on 80 (443 in my case actually) fixes the issue.