Rate Limiting Nginx provides two distinct types of rate limiting mechanisms: Connection frequency control via limit_conn_module Request frequency control via limit_req_module HTTP Connection vs Request Behavior HTTP operates over TCP, requiring a three-way handshake before data transfer begins. Once...
Virtual Host Setup Each server block in Nginx represents a virtual host. Valid configurations include same port/different domain or same domain/different port. Nginx’s default main configuration includes all .conf files under conf.d via include /usr/local/nginx/conf.d/*.conf;. Create a new file ther...
Cross-Origin Resource Sharing Control Browsers restrict cross-origin requests to prevent security vulnerabilities like CSRF attacks. When a malicious website attempts to make requests to your domain on behalf of users, proper CORS configuration becomes essential. Nginx CORS Configuration The `add_he...
Initial Configuration Challenges A recent project required serving both HTTP and WebSocket traffic through a single nginx configuration file. The initial setup was as follows: upstream backend_service { server 10.6.14.200:8000 max_fails=0; } server { listen 80; gzip on; gzip_min_length 1k; gzip_comp...
Containerization with Docker To manage applications efficiently, Docker is used as the primary runtime environment. Ensure system compatibility before proceeding with the installation. Installation via Package Manager Update the local package index and install the necessary dependencies to allow yum...
Nginx serves as a high-performance HTTP server, reverse proxy, and mail proxy (supporting IMAP/POP3 protocols). Originally developed by Igor Sysoev, it efficiently manages concurrent connections while maintaining low CPU and memory footprints, capable of handling tens of thousands of simultaneous re...
Browser Caching Principles HTTP protocol defines caching mechanisms including Expires and Cache-Control headers. Request flow without browser cache: Client → Server → Response (200 OK) Request flow with browser cache: Client → Server → Check Validation → Response (304 Not Modified) Cache Validation...
Introduction to Lua Integration in OpenResty OpenResty provides multiple mechanisms for embedding Lua code directly into the Nginx configuration. This article explores the various methods available for incorporating Lua logic into your OpenResty applications. Methods for Embedding Lua in OpenResty D...
Prerequisites and Installation First, install the necessary libraries for building Nginx from source: yum install -y pcre pcre-devel zlib zlib-devel openssl openssl-devel Download the source package (e.g., vertion 1.14.0), extract it, and compile: cd /opt/downloads tar -zxvf nginx-1.14.0.tar.gz cd n...
Upload Flow The client contacts the Tracker server. Tracker responds with the IP adress and port of a Storage server. The client communicates directly with the Storage server to send the file content and metadata. Storage returns the file's storage identifier, including group name and file name. Fas...