Fading Coder

One Final Commit for the Last Sprint

Nginx Core Concepts and Practical Configuration Guide

Nginx is a lightweight, high-performance web server and reverse proxy server developed by Igor Sysoev from Russia. It excels in handling high concurrency, with reports indicating support for up to 50,000 simultaneous connections. Nginx Features Nginx is widely adopted in internet projects due to sev...

Nginx Modules Reference: Configuration Options and External Module Installation

Nginx Built-in Modules --prefix=/usr/local/nginx # Installation directory --sbin-path=/usr/local/nginx/sbin/nginx # Binary executable path --conf-path=/usr/local/nginx/conf/nginx.conf # Configuration file path --error-log-path=/var/log/nginx/error.log # Error log location --pid-path=/var/run/nginx.p...

Building a Custom Alpine-Based LNP Stack Docker Image

To create a lightweight Docker image based on Alpine Linux that includes Nginx and PHP-FPM (an LNP stack), start by defining a base PHP layer. For compatibility with legacy applications, use PHP 5.6 on Alpine 3.3: # php5.dockerfile FROM alpine:3.3 ENV TIMEZONE=Asia/Shanghai \ PHP_MEMORY_LIMIT=512M \...

Nginx Rate Limiting and Access Control Configuration Guide

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...

Essential Nginx Configuration Recipes for Web Servers

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...

Configuring Cross-Origin Resource Sharing and Anti-Hotlinking in Nginx

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...

Configuring Nginx for WebSocket and HTTP Coexistence in Docker Environments

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...

Cloud Server Environment Setup and Network Port Management

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 Server Configuration and Deployment Strategies

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...

Understanding Nginx Browser Caching Mechanisms

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...