By cholito
Hi! I have a wordpress page with Ubuntu and Nginx. I know .htaccess does not work with nginx for block IPs.
iptables -A INPUT -s 123.123.123.123 -j DROP iptables -A OUTPUT -s 123.123.123.123 -j DROP sudo /sbin/iptables-save I can open my website
server { listen 80; root /var/www/html/myfolder; index index.php index.html index.html server_name mydomain.com www.mydomain.com; rewrite ^/sitemap_index.xml$ /index.php?sitemap=1 last; rewrite ^/([^/]+?)-sitemap([0-9]+)?.xml$ /index.php?sitemap=$1&sitemap_n=$2 last; location / { deny 123.123.123.123; try_files $uri $uri/ /index.php?q=$uri&$args; }
then reload / restar Nginx and i also can open my website from my IP…
Is something wrong? PD:Sorry my English… im from Spain
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
I would recommend using ufw instead of iptables directly as it is much more user-friendly. This tutorial will help you get started.
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.