Posts

Showing posts with the label Nginx

How to Configure ModSecurity WAF on Nginx: Complete Step-by-Step Guide (2026)

Image
  If your Nginx-powered web application is running on a VPS or dedicated server without application-layer protection, every SQL injection (SQLi) attempt and Cross-Site Scripting (XSS) payload reaches your backend directly. Building a self-hosted Web Application Firewall (WAF) using ModSecurity v3 and the OWASP Core Rule Set (CRS) gives you enterprise-grade cybersecurity without expensive monthly SaaS subscriptions. Key Takeaways from This Guide Why ModSecurity v3? Modern libmodsecurity architecture replaces legacy Apache-dependent code with a clean C++ library that connects dynamically to Nginx for better high-traffic performance. Compiling from Source: Guarantees latest security patches on Ubuntu 24.04, Debian 12, and AlmaLinux 9. OWASP Core Rule Set (CRS) Integration: Protects your site against the OWASP Top 10 vulnerabilities right at the server edge. Active Blocking Mode: Safely transition from DetectionOnly mode to active blocking ( SecRuleEngine On ). Quick Deploymen...

How to Stop HLS Video Hotlinking & Bandwidth Theft at the Edge

Image
 If you are hosting premium video content, video hotlinking is a silent budget killer. Every unauthorized embed pulls bandwidth directly from your origin server and bypasses your paywall. Many developers try to fix this using JSON Web Tokens (JWT) at the application layer. However, for high-throughput HLS streaming, JWTs are overkill. At 1,000 concurrent viewers, your application layer is suddenly processing hundreds of validation requests per second, creating a massive upstream bottleneck. The Native Edge Solution: Nginx Secure Link The most efficient way to stop bandwidth theft natively is using the Nginx Secure Link module. It validates incoming video requests by computing an MD5 hash from a secret key, the request URI, the client IP, and an expiration timestamp, all inside Nginx itself. The Security Flaw Most Developers Miss If you look up generic tutorials on this setup, they almost always tell you to protect your master .m3u8 manifest file. This is a critical vulnerability. ...