R
R
Rokis2017-03-19 18:34:10
iptables
Rokis, 2017-03-19 18:34:10

How to restrict IP access to wp-login.php on server via iptables?

Hello.
I restrict access to wordpress through nginx:

location /wp-login.php {
allow 111.111.111.11;
allow 22.222.222.222;
deny all;
 location ~ \.php$ {
fastcgi_pass unix:/run/php/php7.0-fpm.sock;
include snippets/fastcgi-php.conf;
} }

How can I do the same with iptables? (if at all possible of course)

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
Valentine, 2017-03-19
@Rokis

Restricting access to a specific url is not the job of iptables, it does not have such functionality, and I hope it will not. Iptables does l4 filtering well, it doesn't need anything else. But if you really really want to restrict access to the directory through it, move the admin panel to a separate IP/port (for example, in the nginx config through a proxy) and filter this ip/port.
As an option, dpi, but filtering the URL on the web server through this technology is like a cannon on sparrows.
www.ntop.org/products/deep-packet-inspection/ndpi

P
Puma Thailand, 2017-03-19
@opium

you need to install advanced ipitables modules that can parse packets at a high axis level and already open and deny access there

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question