How to configure multiple site Nginx proxy in the command line environment for AnQiCMS?

Calendar 👁️ 64

Hello! As an experienced AnQi CMS operation personnel, I am very happy to be able to explain in detail how to efficiently configure Nginx reverse proxy to support the multi-site deployment of AnQiCMS under the command-line environment.AnQiCMS's powerful multi-site management function, combined with the flexible proxy mechanism of Nginx, can help you easily manage multiple independently running websites on the same server, greatly enhancing operational efficiency.

Introduction

AnQiCMS (AnQiCMS) is favored by small and medium-sized enterprises and content operation teams for its high-performance architecture based on the Go language and its concise and efficient features.Among them, multi-site management is one of its core highlights, allowing users to independently operate multiple websites under a single system instance.When deploying AnQiCMS in a command-line environment, how to use Nginx as a reverse proxy to effectively configure these multi-sites is a key skill that many operators need to master.This article will guide you step by step through this configuration process.

Understanding the multi-site mechanism of AnQiCMS

Before delving into the configuration, it is first necessary to clarify the principle of AnQiCMS's multi-site operation.A core advantage of AnQiCMS lies in the fact that a running AnQiCMS instance (usually listening on a specific port, such as 8001) can serve multiple different frontend domains through its built-in multi-site management feature.Nginx plays the role of traffic distribution and reverse proxy here, it forwards requests to the same AnQiCMS backend port based on different domain names visited by users.AnQiCMS backend then identifies which site is initiating the request based on the Host header information forwarded by Nginx, and provides the corresponding site content.This means you do not need to run an independent AnQiCMS process for each site, thereby saving server resources and simplifying management.

Preparation

Before starting the configuration, make sure that your Linux server meets the following conditions:

  • Linux Operating System:Recommended to use mainstream distributions such as Ubuntu, CentOS, etc.
  • Nginx is installed and running:Nginx will act as your reverse proxy server.
  • The MySQL database is installed and running:AnQiCMS needs a database to store data.
  • Domain resolution:All the domain names you plan to use for multiple sites have been correctly resolved to your server IP address.

Deploy the main AnQiCMS instance

Firstly, we need to deploy and initialize an AnQiCMS master instance. This instance will be the backend service provider for all other sites.

Download and extract

Please download the latest Linux version package from the AnQiCMS official website and upload it to your server. Typically, we would place it in a meaningful directory, such as/www/wwwroot/anqicms_main. Extract the installation package:tar -xzvf anqicms-linux-vX.x.x.tar.gz -C /www/wwwroot/anqicms_mainEnter the directory after extraction:cd /www/wwwroot/anqicms_main

Daemon process configuration

To ensure that the AnQiCMS service can automatically start and run stably after the server restarts, we usually usecrontabto set up a daemon. Create a namedstart.shThe startup script is located in/www/wwwroot/anqicms_maindirectory, the content is as follows:

#!/bin/bash
BINNAME=anqicms
BINPATH=/www/wwwroot/anqicms_main

exists=`ps -ef | grep '\<anqicms\>' |grep -v grep |wc -l`
if [ $exists -eq 0 ]; then
    cd $BINPATH && nohup $BINPATH/$BINNAME >> $BINPATH/running.log 2>&1 &
fi

Add execute permission to the script:chmod +x /www/wwwroot/anqicms_main/start.shNext, add this script tocrontabIn order to check AnQiCMS every minute to see if it is running, and if not, start it:crontab -eIn the opened editing interface, add the following line and save and exit:*/1 * * * * /www/wwwroot/anqicms_main/start.shManually execute the startup script once to ensure that the AnQiCMS service has started running:/www/wwwroot/anqicms_main/start.sh

Main site Nginx configuration

Configure Nginx reverse proxy for your first (main) AnQiCMS site.

Related articles

How to merge multiple AnQiCMS 2.x sites into one 3.x management?

As an experienced AnQiCMS website operation personnel, I fully understand your desire to unify multiple existing AnQiCMS 2.x sites into the 3.x version for management.The AnQiCMS 3.x version has made significant optimizations in multi-site management, aiming to simplify operations and improve efficiency.The article will detail this merging process, helping you complete the upgrade smoothly. ### Unified Management: Merging Multiple AnQiCMS 2.x Sites into 3.x Management With the release of AnQiCMS 3.x version, the multi-site management model has ushered in innovation.

2025-11-06

What impact does upgrading from AnQiCMS 2.x to 3.x have on existing multiple sites?

As an experienced CMS operation personnel in the security field, I am well aware of the importance of system upgrades for the stable operation of the website, especially when managing multiple sites, any change may cause a chain reaction.The Anqi CMS has upgraded from version 2.x to 3.x, the core of which lies in the innovation of underlying deployment and multi-site management mode, which will have a profound impact on your existing multiple sites, but on the whole, it is moving towards a more efficient and stable development direction.### The features of the multi-site management mode of AnQiCMS 2.x In AnQiCMS 2.x era

2025-11-06

How does AnQiCMS's security mechanism ensure content security across multiple sites?

AnQi CMS is a content management system designed specifically for small and medium-sized enterprises and content operation teams, which provides efficient, customizable, and easy-to-expand solutions while particularly focusing on content security in a multi-site environment.A deep understanding of its security mechanisms is crucial for operators to effectively manage and protect digital assets.The AnQi CMS adopts a multi-dimensional and deep-level protection strategy in terms of content security across multiple sites, with the core being the effective isolation of data and permissions, supplemented by comprehensive content protection functions.

2025-11-06

How does AnQiCMS's modular design facilitate secondary development across multiple sites?

As an experienced security CMS website operator, I am well aware of the core value of a content management system (CMS) in its flexibility and scalability, especially when dealing with multi-site management and secondary development requirements.AnQiCMS (AnQi CMS) is precisely based on its excellent modular design, providing a solid foundation for developers and operators, enabling them to be proficient in secondary development of multiple sites.The modular design philosophy of AnQiCMS runs through its entire system architecture.It is not a rigid, integrated system, but rather a series of independent and collaborative functional modules

2025-11-06

How to troubleshoot and solve the port occupation problem during AnQiCMS installation?

Hello!As an experienced CMS website operator for a cybersecurity company, I fully understand the trouble of encountering port occupation problems during the system installation process.This is indeed a common situation encountered by beginners, but as long as you master the correct method, troubleshooting and solving it is not complicated.Below, I will elaborate on how to troubleshoot and resolve the issue of port occupation during the AnQiCMS installation process.

2025-11-06

What is the default directory structure of template files in AnQiCMS multi-site mode?

AnQiCMS is a system designed to provide an efficient content management solution for small and medium-sized enterprises and content operation teams. Its template file organization structure under the multi-site mode is carefully designed to ensure flexibility, maintainability, and independence.In a multi-site environment, AnQiCMS allows administrators to manage multiple sets of templates in a unified template library and to select appropriate template sets for each site, thereby decoupling content from presentation.

2025-11-06

How to specify an independent mobile template for multi-site in AnQiCMS template creation?

HelloAs an experienced Anqi CMS website operation personnel, I fully understand the importance of providing an optimized experience for different sites in the increasingly growing mobile traffic trend.The advantages of AnQi CMS in multi-site management and template flexibility make it very convenient to specify dedicated mobile templates for each independent site.Below, I will elaborate on how to achieve this goal in Anqi CMS.

2025-11-06

How does the AnQiCMS backend custom URL affect multi-site SEO?

As a website owner who deeply understands the operation of AnQiCMS, I know that a flexible and SEO-friendly URL structure is important for a website, especially for multi-site operations.AnQiCMS offers powerful backend URL customization capabilities, which not only greatly enhances the accessibility of content but also lays a solid foundation for the implementation of SEO strategies across multiple sites.

2025-11-06