Category: Nginx

How to Add Yunsuo WAF Module to Tengine

Note: This article applies to servers where Tengine was previously installed but the Cloud Lock module was not installed.
Environment: CentOS, Cloud Lock, Tengine
yum -y install jemalloc pcre* openssl*Backup before installation: cp /usr/local/nginx/sbin/nginx /usr/local/nginx/sbin/nginx …

Guide to Installing Nginx Module for Yunsuo

In many cases, because we have compiled our own Nginx, the official Nginx automatic module may fail to install or encounter errors. Below, we will reinstall the Nginx module to better protect our website:

Note: For the latest v3 version, please visit https://www.cnop.net/html/news/security …

How to Rotate Nginx Logs Using Logrotate

As the name suggests, logrotate is specifically designed for log rotation. Simply place task configurations under /etc/logrotate.d/ and the tasks will run automatically. It requires no installation and comes built-in with the system, making it highly recommended.
# vi /etc/logrotate.d/nginx
Fill in the following information:

/home/wwwl …

How to Write a Correct Nginx 301 Redirect

How to Redirect HTTP to HTTPS in Nginx
Redirecting HTTP to HTTPS uses Nginx’s rewrite command. So how should you write the redirect? Older versions of Nginx might have used a format similar to the following.
rewrite ^/(.*)$ http://domain.com/$1 permanent;
或者
rewrite ^ http://d …

Nginx Load Balancing Configuration Examples and Guide

Let’s start with a brief overview of what load balancing is. Taken literally, the term means distributing the load evenly across N servers so that no single server is overwhelmed and crashes while another sits idle. The prerequisite for load balancing, then, is having multiple servers to implement it, which means …

How to Install SSL Certificate on Linux with Nginx

Nginx SSL certificate installation requires two configuration files: 1_root_bundle.crt and 2_domainname.com.key.
Note: These certificate files are all located in the folder for Nginx.zip,
e.g., 1_root_bundle.crt is the root certificate chain (public key), and 2_ domainname.com.key is the private key. (Where: certificate public …

Nginx Configuration File nginx.conf: A Complete Guide

PS: I’ve been using Nginx for two to three years now, and I often encounter new users asking some very basic questions. I don’t have time to answer them one by one, so this afternoon I spent some time compiling a share of the main Nginx configuration parameter explanations based on my own experience, also referencing some online content. This is currently the most complete Nginx configuration guide…

How to Install LNMP Stack with One Command

System Requirements: CentOS/Debian/Ubuntu Linux systems need 2GB+ of free disk space and 128MB+ of RAM. For OpenVZ, 192MB+ is recommended (do not use a 64-bit system with low memory). The VPS or server must have an active internet connection! Linux is case-sensitive, so please pay attention when entering commands! LNMP one-click installation package V1 …