Webserver setup, port forwarding seems to be happening and don't know why

NimChimpsky asked:

[[email protected] 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

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

And iptables :

[[email protected] 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

My answer:


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.


View the full question and any other answers on Server Fault.

Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.