K
K
Kir Shatrov2011-05-10 21:58:29
Apache HTTP Server
Kir Shatrov, 2011-05-10 21:58:29

Nginx as a reverse proxy

Installed, configured - Apache now hangs on port 8080.
How to close this port so that no one has direct access to Apache?
OS - Ubuntu Server 10.04

Answer the question

In order to leave comments, you need to log in

5 answer(s)
L
lazyk, 2011-05-10
@RazoR_Empire

write Listen only 127.0.0.1
Listen 127.0.0.1:8080

S
Sergey, 2011-05-11
@bondbig

There is no point in all these towns with iptables, it looks like if you made a window in the house, then to board it up with boards. The listen directive suggested above is the correct way.

X
xaker1, 2011-05-10
@xaker1

Well, or at the level of the firewall.
iptables -t filter -A INPUT -i eth0 -p tcp --dport 8080 -j DROP
to remove the rule
iptables -t filter -D INPUT -i eth0 -p tcp --dport 8080 -j DROP
*I can't vouch for the syntax, iptables I do not use it, Google prompted these commands
Perhaps instead of eth0 you will need to specify another interface.

A
angelov, 2011-05-10
@angelov

If on Linux it is possible in iptables By the first rule, you allow packets coming from nginx. Yours may be 127.0.0.1 or whatever. Second you deny all other packages
iptables -A INPUT -p tcp -s [АЙПИ.НДЖИНКСА] --dport 8080 -j ACCEPT
iptables -A INPUT -p tcp --dport 8080 -j DROP

T
Tucker56, 2011-05-11
@Tucker56

For Ubuntu, a wrapper over iptables is used - ufw.
Therefore, you can close this port like this sudo ufw deny 8080.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question