Nginx + iptables redirect and block

C. Porto

I'm confused by nginx and iptables, I'm not sure when I should redirect or block specific ports with nginx or iptables, e.g. I want to keep ports 443 and 8443 open for traffic and redirect all traffic form other ports to them, should I block the other ports with iptables or redirect with nginx?

codebox

You almost certainly don't want to redirect traffic from all other ports to 443/8433. If you have a web application running on those ports then just configure nginx to listen there and block everything else with iptables.

If you have connection attempts to your server on other ports then it could be anything - misconfigured software from anywhere on the internet, or someone port scanning, just block it and your life will be simpler.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related