0
[me@myserver myDir]# wget http://127.0.0.1
--2020-08-17 10:45:45--  http://127.0.0.1/
Connecting to 172.31.2.21:8080... connected.
Proxy request sent, awaiting response... 200 OK

Why is my request being forwarded to port 8080, and what is doing the forwarding

[me@myserver myDir]# netstat -tulpn | grep :80
tcp        0      0 172.31.2.121:80         0.0.0.0:*               LISTEN      5643/httpd

And iptables :

[me@myserver mydir]# iptables -S
-P INPUT DROP
-P FORWARD DROP
-P OUTPUT DROP
-A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
-A INPUT -p icmp -j ACCEPT
-A INPUT -i lo -j ACCEPT
-A INPUT -s 127.0.0.0/8 -j DROP
-A INPUT -p tcp -m state --state NEW -m tcp --dport 22 -j ACCEPT
-A INPUT -p tcp -m state --state NEW -m tcp --dport 25 -j ACCEPT
-A INPUT -p tcp -m state --state NEW -m tcp --dport 161:162 -j ACCEPT
-A INPUT -p udp -m udp --dport 161:162 -j ACCEPT
-A INPUT -p udp -m udp --dport 323 -j ACCEPT
-A INPUT -j REJECT --reject-with icmp-host-prohibited
-A FORWARD -j REJECT --reject-with icmp-host-prohibited
-A OUTPUT -o lo -j ACCEPT
-A OUTPUT -p udp -m udp --dport 53 -j ACCEPT
-A OUTPUT -p tcp -m tcp --dport 53 -j ACCEPT
-A OUTPUT -p udp -m udp --dport 123 -j ACCEPT
-A OUTPUT -p udp -m udp --sport 161:162 -j ACCEPT
-A OUTPUT -d 10.0.0.0/8 -p tcp -j ACCEPT
-A OUTPUT -d 172.0.0.0/8 -p tcp -j ACCEPT
-A OUTPUT -j ACCEPT

Its a fresh install of apache http server, no redirects setup

1

Your system is configured to send web traffic through a proxy server. wget is just obeying that directive and contacting the proxy to pass on your request. You can attempt to bypass the proxy server by adding --no-proxy to the command line.

3
  • Thankyou. Where/how is the proxy setup ? – NimChimpsky Aug 17 '20 at 3:03
  • Aren't you the person who set it up?! Most likely it's set in environment variables in the shell startup scripts in /etc. – Michael Hampton Aug 17 '20 at 3:05
  • I have an IT team "helping" me, thanks – NimChimpsky Aug 17 '20 at 3:12

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