Tagnginx

Fail2ban + WordPress + Nginx

I’ve been using the Limit Login Attempts plugin for WordPress for quite a while. It basically logs failed login attempts and automatically blocks multiple attempts from a single IP address. A few days ago I’ve switched to fail2ban instead, which is pretty new to me. Fail2ban is a fairly simple yet very flexible framework that monitors log files for certain patterns, and runs...

Google Analytics Proxy with Nginx

Here’s a quick tip! If you need to serve a specific script, stylesheet or any other file from your own domain, you can easily proxy it with nginx. A good example is the ga.jsĀ file for Google Analytics. Here’s how I proxy it with nginx, in the server context: # Google Analytics Proxy rewrite ^/ga.js$ /ga/ last; location /ga/ { proxy_pass ; break; } This rewrites the ga.js filename to...