I have these following container running on a server:
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
c21c339e1299 gitlabanalyzer_frontend "nginx -g 'daemon of…" 3 minutes ago Up 3 minutes 0.0.0.0:8181->80/tcp gitanalyzer-frontend
b3863853402c gitlabanalyzer_backend:latest "java -jar app.jar" 3 minutes ago Up 3 minutes 0.0.0.0:8080->8080/tcp gitanalyzer-backend
724c2cf79b67 gitlab/gitlab-ee:13.8.0-ee.0 "/assets/wrapper" 5 weeks ago Up 5 weeks (healthy) 0.0.0.0:22->22/tcp, 0.0.0.0:443->443/tcp, 0.0.0.0:8282->80/tcp gitlab_server_container_gitlab_1
I used nginx for reverse proxy (not a container), the content of /etc/nginx/conf.d/default.conf
is:
server {
listen 80;
server_name XXX;
location / {
proxy_pass http://localhost:8181;
}
location /gitlab {
proxy_pass http://localhost:8282;
}
}
So the frontend send API requests to the backend and the backend in turn, makes API requests to the gitlab server. All 3 containers are on the same machine. However, I keep getting: java.net.ConnectException: Connection refused (Connection refused)
when the backend trying to connect to the gitlab server.
When I run a the backend from a different machine, I can connect the gitlab server on the server just fine, however, I got connection error when I try to run everything on the server.
Please help me out with how to solve this.