How to configure Nginx pseudo-static rules for AnQiCMS on the Baota panel?

Calendar 👁️ 65

As an experienced CMS website operation manager for a security company, I am well aware of the decisive role of efficient content management and excellent search engine optimization (SEO) in the success of a website.Static page generation is an indispensable part of it, not only does it make the URL structure of the website simpler and more beautiful, but more importantly, it can significantly improve the search engine's ability to capture and understand the content of the website.AnQiCMS was designed with this point in mind from the beginning, built-in with powerful pseudo-static management functions, but to maximize its effectiveness, the Nginx pseudo-static rule configuration on the server side is crucial.

This article will provide a detailed guide on how to configure Nginx pseudo-static rules for your AnQiCMS website in the Baota panel.This configuration is designed to correctly forward all requests that match the pseudo-static mode to the AnQiCMS application, while ensuring that static resources can be loaded efficiently, thereby optimizing the overall performance and SEO of the website.

Preparation before configuration

Before you start configuring Nginx's pseudo-static rules, please confirm that your server environment is ready.You need to make sure that the Baota panel is successfully installed, and your AnQiCMS website has been successfully deployed through the Baota panel (whether through a Go project or Docker), and the corresponding domain has been bound.The AnQiCMS application is usually local127.0.0.1:8001The port is running, the Nginx configuration will be responsible for proxying external requests to this port.

Understand the pseudo-static mechanism of AnQiCMS

AnQiCMS provides flexible pseudo-static management features, allowing website administrators to customize URL structures according to content types (such as articles, products, single pages, tags, etc.) and personal preferences.In the AnQiCMS backend feature management, you can find the 'Static rules' option, select preset modes (such as number mode, model naming mode, category naming mode) or enter advanced custom mode.These internal settings define how the AnQiCMS application itself generates and parses friendly URLs for various content.The role of Nginx's pseudo-static rules is to act as a bridge at the server level, ensuring that when users or search engines access these friendly URLs, Nginx can seamlessly forward them to the AnQiCMS application for processing, rather than directly searching for non-existent files in the file system.

Configure Nginx rewrite rules in Baota panel

Configure Nginx rewrite rules is the key step to ensure that AnQiCMS rewrite links work normally. Please follow the following instructions in the Baota panel:

First, log in to your Baota panel. Click the 'Website' option in the left navigation menu.In the website list, find the AnQiCMS website you have deployed and click the "Settings" button in the operation column to enter the detailed configuration interface of the website.

After entering the website settings interface, you will see multiple configuration tabs.First, click the "Website Directory" tab. Here, you need to set the website "runtime directory" to the root directory of your AnQiCMS.publicFolder. For example, if your AnQiCMS project files are stored in/www/wwwroot/yourdomain.com, then the correct running directory should be set to/www/wwwroot/yourdomain.com/public. This is because the static resources (such as CSS, JS, images, etc.) of AnQiCMS are stored in this directory by default, while the dynamic content is processed by the application.After setting up, please be sure to click Save.

Next, switch to the "pseudo-static" tab. This is the core area for configuring Nginx pseudo-static rules.Please paste the following Nginx configuration code into the text box.This code is necessary for the normal operation of AnQiCMS pseudo-static pages.After pasting, click the save button. If you want to save this rule for future quick application to other AnQiCMS websites, you can also choose the 'Save as template' option.

location @AnqiCMS {
    proxy_pass https://en.anqicms.com;
    proxy_set_header   Host             $host;
    proxy_set_header   X-Real-IP        $remote_addr;
    proxy_set_header   X-Forwarded-For  $proxy_add_x_forwarded_for;
}
error_page 404 =200  @AnqiCMS;
location / {
   try_files $uri $uri/index.html @AnqiCMS;
}

Nginx rewrite rule parsing

Let's briefly analyze this Nginx configuration code to help you understand its working principles:

location @AnqiCMS { ... }Defined a named@AnqiCMSinternal Location block. When otherlocationThe block needs to forward the request to the AnQiCMS application when this block is referenced.proxy_pass https://en.anqicms.com;It is a core instruction that tells Nginx to proxy all requests forwarded to this block.https://en.anqicms.comPort, this is the address and port that the AnQiCMS application usually listens to.proxy_set_headerThe series of commands is used to ensure that AnQiCMS can correctly obtain the original request information from the client, such as the real Host, IP address, etc.

error_page 404 =200 @AnqiCMS;This line is the key to implementing pseudo-static. It indicates that if Nginx does not find the corresponding static file in the file system for a request, causing Nginx to return a 404 error, then Nginx should not send a 404 response directly to the client. Instead,

Related articles

How to install AnQiCMS's Go project on a Linux server?

As a website operator familiar with AnQiCMS, I fully understand the importance of an efficient, stable, and easy-to-manage content system for website operation.AnQiCMS is a modern enterprise-level content management system developed based on the Go language, with its high concurrency, high security, easy deployment, and excellent SEO-friendly features, it has become an ideal choice for many small and medium-sized enterprises and content operation teams.This article will detail how to install and deploy AnQiCMS's Go project on a Linux server, aiming to help you smoothly set up your own website.###

2025-11-06

What operating systems does AnQiCMS support for deployment and use?

As an experienced AnQi CMS website operations personnel, I am very clear about the deployment and usage of AnQi CMS in different operating system environments.AnQiCMS is an enterprise-level content management system developed based on the Go language, which was designed with cross-platform compatibility in mind, aiming to provide users with flexible and diverse deployment options.

2025-11-06

What are the advantages and disadvantages of AnQiCMS using the `start.sh` + `crontab` process guard scheme compared to `systemd` in enterprise-level applications?

As a senior CMS website operation personnel of a well-known security company, I know that the stable and efficient operation of the system is the core of enterprise content management.How to choose the appropriate process protection scheme when deploying AnQiCMS, ensuring that the system can continuously and stably provide services in various situations is a crucial issue.Currently, the AnQiCMS documentation recommends a guard method based on the `start.sh` script combined with `crontab` scheduled tasks.

2025-11-06

How can the security of the AnQiCMS process be ensured if the `start.sh` script itself fails or is tampered with?

As an experienced AnQiCMS website operations manager, I am well aware that system stability and security are crucial for content management.AnQiCMS provides a solid foundation for users with its high performance and security brought by the Go language development, but even so, any system cannot do without the guarantee of its operating environment.Regarding the security of the `start.sh` script, it is a fundamental issue involving system startup and process management, and its importance should not be overlooked.### `start

2025-11-06

What is the main function of the startup script `start.sh` written by "author fesion" in the AnQiCMS task schedule?

In the daily operation of AnQiCMS (AnQiCMS), the stable operation of the system is the key to ensuring user experience and content distribution efficiency.To ensure that the AnQiCMS service can provide content continuously and uninterruptedly, even if it encounters unexpected interruptions and can recover quickly, a meticulously designed startup script plays a crucial role in the scheduled tasks.Among them, the `start.sh` script written by "author fesion" was born for this purpose, and it constitutes the core of the self-protection mechanism of AnQiCMS service.### `start

2025-11-06

How to use the stop script `stop.sh` written by author fesion in AnQiCMS?

AnQiCMS (AnQiCMS) is a high-efficiency and feature-rich Go language content management system, its stable operation cannot do without refined deployment and management.As a website operator, we not only need to pay attention to content creation and optimization, but also ensure the smooth operation of the system backend.In this case, the stop script `stop.sh` plays a crucial role, which can help us safely and effectively manage the lifecycle of AnQiCMS services.### Core function to stop the script `stop.sh` `stop

2025-11-06

How to deploy multiple independent AnQiCMS sites on the same physical server?

In the rapidly changing digital age, businesses and content operators often face the challenge of managing multiple websites.AnQiCMS (AnQiCMS) is an efficient content management system developed based on the Go language, and its multi-site management function is exactly designed to solve this pain point.As an experienced website operator proficient in AnQi CMS, I am well aware of the readers' desire for efficient and convenient solutions.Today, I will elaborate on how to deploy multiple independent security CMS sites on the same physical server, helping you optimize resources and simplify management.## Start Your Multi-Site Journey

2025-11-06

How to configure the new site root directory for AnQiCMS multi-site deployment to achieve data isolation?

As an experienced security CMS website operator, I am well aware of the core role of the content management system in today's digital marketing.Especially when facing the needs of multi-site operations, the powerful functions and flexible configuration provided by AnQiCMS are undoubtedly our reliable assistant.Among them, how to properly configure the root directory of a new site to achieve data isolation is a key link to ensure the efficient and safe operation of multiple sites.

2025-11-06