1

I can't connect to an application through an External IP.

I started a gerrit code review application on a GCP's Compute Engine instance (with CentOS 7).

It works on a console, by curl http://localhost:8080 but I can't connect to it through external IP.

I've also tried to create a NGINX server. After installing NGINX, the starter page were shown on external ip, but the reverse proxy configuration does not show gerrit register page.

server {
listen 80;

access_log /var/log/nginx/gerrit_access.log;
error_log /var/log/nginx/gerrit_error.log;

location / {
    proxy_pass   http://127.0.0.1:8080;
    index  index.html index.htm;
    try_files $uri $uri/ =404;
}
}

gerrit.config
[httpd]
listenUrl = proxy-http://127.0.0.1:8080/

Finally, I want to see gerrit register page when using an external ip.

1

That Nginx reverse proxy configuration seems correct, but I would definitively recommend using HTTPS if you're going to expose this to the outside world.

A few things you need to keep in mind:

  • Make sure gerrit is running and listening on port 8080. You can do that with netstat -atun | grep 8080.
  • I would also check out this document to make sure you gerrit configuration is correct.
  • If you didn't allow HTTP traffic when creating the VM instance, you will need to tag the instance with the default "http-server" firewall tag.
  • Make sure firewalld isn't blocking incoming incoming traffic.

If none of that solves it I would start by looking at nginx logs and examine the output on your browser.

0

Make sure the app is listening on 0.0.0.0 and make sure the firewall for this port is enabled.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.