F
F
friktor2014-11-03 13:57:48
Nginx
friktor, 2014-11-03 13:57:48

How to close a port for external viewing in nginx?

I have a running web application running on port 3333, in nginx via proxy_pass the path is specified to listen to it, it is necessary that access is directly only to the site - and that it is impossible to access this site via http://ip_address:3333.
How to do it in the config file?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
G
Glueon, 2014-11-03
@Glueon

Hang the application not only on port 3333, but at the same time on 127.0.0.1

S
Sergey Petrikov, 2014-11-03
@RicoX

Option 1: Hang on the localhost, then there will be no access from the world.
Option 2: Disable on the firewall, but the first option is more correct.
Option 3: Break the SELinux policies by allowing only certain applications to access the port, but the first option is less troublesome.

S
Sergey, 2014-11-03
Protko @Fesor

Set a rule in iptables to drop all packets that come from external to this port (ideally, you should have access to external only ports 80, 443 and 22 + those that are needed directly to work with third-party services, such as pushes and td)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question