HAproxy isn't detecting the server, while curl functions on Windows but not on Linux.
HAproxy isn't detecting the server, while curl functions on Windows but not on Linux.
Hey everyone, I’m trying to figure this out because I’m feeling a bit stuck. I run a home lab where I experiment with various tools, and I use Gitea on a separate port through haproxy for load balancing. Everything seemed normal until now. I recently switched to using Let’s Encrypt via haproxy, but my Git server isn’t responding when I try to connect. I know the server works fine when I ping it directly, but when I use the proxy settings, it just hangs. I also noticed the health checks keep returning success codes, yet the Git port isn’t getting through. Could you help me understand what might be going wrong?
Windows to WebServer C:\Users\Thomas>curl -v 192.168.4.200:80 * Updated path to: 192.168.4.200:80/ * Attempting 192.168.4.200... * TCP_NODELAY enabled * Linked to 192.168.4.200 (192.168.4.200) port 80 (#0) > GET / HTTP/1.1 > Host: 192.168.4.200 > User-Agent: curl/7.55.1 > Accept: */* > < HTTP/1.1 200 OK < Timestamp: Thu, 30 Jan 2020 21:51:47 GMT < Server: Apache < Last-Modified: Mon, 11 Nov 2019 22:43:15 GMT < ETag: "2-59719db6ec6c0" < Accept-Ranges: bytes < Content-Length: 2 < Content-Type: text/html < Start-Refresh>Connection #0 to host 192.168.4.200 remains stable</Server> > GET / HTTP/1.1 > Host: 192.168.4.200 > User-Agent: curl/7.47.0 > Accept: */* > < HTTP/1.1 200 OK < Date: Thu, 30 Jan 2020 21:51:49 GMT < Server: Apache < Last-Modified: Mon, 11 Nov 2019 22:43:15 GMT < ETag: "2-59719db6ec6c0" < Accept-Ranges: bytes < Content-Length: 2 < Content-Type: text/html><Content>Linux to WebServer root@D-LoadBalancer:/home/administrator</Content></Start-Refresh>
Administrator@server:~$ curl -v localhost:3000 * Updated address to: localhost:3000/ * Attempting ::1... * Connected to localhost (::1) port 3000 (#0) > GET / HTTP/1.1 > Host: localhost:3000 > User-Agent: curl/7.47.0 > Accept: */* > < HTTP/1.1 302 Found < Content-Type: text/html; charset=utf-8 < Location: /explore < Set-Cookie: lang=en-US; Path=/; Max-Age=2147483647 < Set-Cookie: i_like_gitea=ec85572f80d33bbe; Path=/; HttpOnly < Set-Cookie: _csrf=Np3J33SmZkolOPfsidXXNRovLX46MTU4MDQyMTU0MjUwNzYyOTkwNw%3D%3D; Path=/; Expires=Fri, 31 Jan 2020 21:59:02 GMT; HttpOnly < X-Frame-Options: SAMEORIGIN < Date: Thu, 30 Jan 2020 21:59:02 GMT < Content-Length: 31 < <a href="/explore">Found</a>. * Connection #0 to host localhost remains unchanged
It looks like the proxy settings might be off. Check the HTTP response for clues about the proxy software in use. Ensure the Apache server is configured to listen on all interfaces (0.0.0.0). Verify the firewall isn’t blocking traffic from specific IP addresses. Also confirm your Linux client is on the same network as the server.
Right now I’m not relying on a proxy. I’m trying to fix things by using curl with my Apache server and Gitea, both running on the same physical machine. There’s no firewall between the proxy I’m connecting from and the web/server where I’m accessing it. Both are on the same network, so I can reach them easily. The issue seems to be somewhere in the configuration. I notice curl works fine at port 80 but fails at 3000. If it were just a proxy, I’d treat it like a regular Linux server.
It means apache server is not returning any response. It might be it is not listening on that port or that you block it. For first case, any other machine should get the same error including windows and when you are curling on the server machine itself. Print the terminal output using this command. sudo netstat -tulpn
Apache functions properly, but Gitea isn't responding (uncertain backend used). It appears to fail only from your other Linux machine, while it works on Windows. The output shown suggests connections are being accepted on the web/git server, not from local machines. Active Internet links detected (servers only). Protocols: TCP, UDP. PIDs and addresses vary across services.