R
R
Roman2021-08-29 01:30:11
Node.js
Roman, 2021-08-29 01:30:11

How to deny access to nodejs application by IP:PORT address?

Actually a subject.
There is a nodejs application - a website, running behind nginx proxy. I want to prohibit access to the application at 100.111.222.333:3000 (so that the site can only be accessed by domain).
In the ip address option, nginx's static service does not work, and this is an extra load.
Yes, there are those who access by ip:port. No, constantly changing the application port address is not appropriate.
100.111.222.333:3000 does not open, gives an error
https://100.111.222.333:3000 is available

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Roman, 2021-08-29
@r0n1x

Found working rules for my task

iptables -A INPUT -i lo -j ACCEPT
iptables -A INPUT -i eth0 -p tcp --dport 3000 --match state --state NEW -j ACCEPT
iptables -A INPUT -p tcp --dport 3000 -j DROP

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question