Pre Exam Test Practice (SSC | Banking | IAS | GATE | State Level | CLAT | Railways | Insurance | Teaching Exams | NDA | Defence | IES |State Exam )

Organizational Research By

Surprising Reserch Topic

How to deny an IP in Nginx server with Wordpress?

I try to deny one IP per exemple my mobile ip: in IPTables unsuccessfully with this:

iptables -A INPUT -s -j DROP
iptables -A OUTPUT -s -j DROP 
sudo /sbin/iptables-save 
I can open my website

I also try with virtual servers in /etc/nginx/sites-available/

server {
listen 80;
root /var/www/html/myfolder;
index index.php index.html index.html
rewrite ^/sitemap
index.xml$ /index.php?sitemap=1 last;
rewrite ^/([^/]+?)-sitemap([0-9]+)?.xml$ /index.php?sitemap=$1&sitemapn=$2 last;
location / {
files $uri $uri/ /index.php?q=$uri&$args;

then reload / restar Nginx and i also can open my website from my IP....

asked Aug 30, 2015 in LINUX by rajesh
0 votes

Related Hot Questions

Government Jobs Opening