Fading Coder

One Final Commit for the Last Sprint

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

Integrating Lua Scripts into OpenResty: A Comprehensive Guide

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

Getting Started with Nginx: Installation, Configuration, and Reverse Proxy Setup

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

File Upload and Download Process with FastDFS

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

Building Nginx from Source for Static File Hosting on Ubuntu

To compile Nginx on Ubuntu for serving static content, first install the toolchain and required libraries: sudo apt update sudo apt install -y build-essential libpcre3-dev zlib1g-dev libssl-dev The build environment requires PCRE for regex support in location blocks, zlib for gzip compression module...

Configuring Domain Names for Node.js, Vue SPA, and SSR Applications

Domain Name Registration Register a domain name through a domain registrar such as Tencent Cloud. DNS Record Configuration Configure DNS records in your domain management panel to point the domain to your server's IP address. Nginx Server Block Setup Naivgate to the Nginx configuration directroy: cd...