As an experienced CMS website operation person in the security industry, I know the importance of correctly configuring reverse proxy in complex website architectures, especially when it comes to managing multiple sites.It not only relates to the normal access of the website, but also directly affects the user experience and search engine optimization.Today, let's delve deeply into what should be filled in as the crucial 'proxy address' in the AnQiCMS multi-site reverse proxy configuration.
Understanding the connection mechanism between reverse proxy and AnQiCMS
Before starting the configuration, we first need to understand the role of reverse proxy in website architecture.In simple terms, a reverse proxy server (such as Nginx, Apache) is the entry point for user requests.It receives access requests from external sources, then forwards these requests to the internal backend services for processing, and returns the responses from the backend services to the users.For AnQiCMS, it is an independent application that usually listens for requests on some port of the server.The role of reverse proxy is to forward the requests accessed by users through domain names (default 80 or 443 ports) to the port that AnQiCMS is actually listening on.
AnQiCMS as a CMS system developed based on the Go language, after deployment, it will listen on a default port to provide services. According to the AnQiCMS documentation, the default listening port is usually8001This means that the AnQiCMS application is running internally on your server and providing content management services through this port.
Reverse proxy address of a single AnQiCMS instance.
When you run on the serveran instance of the AnQiCMS applicationAnd when carrying multiple domain websites through its built-in "multi-site management" feature, all these domains ultimately need to be forwarded to the same AnQiCMS instance via reverse proxy.In this case, your reverse proxy address should point to the internal address and port that the AnQiCMS application is listening on.
Generally, if the AnQiCMS application runs on the same machine as your reverse proxy server, the proxy address should be filled in as the local loopback address127.0.0.1Add AnQiCMS listening port. For example, if AnQiCMS is running on the default 8001 port, then the proxy address should be filled in as:
http://127.0.0.1:8001
Here127.0.0.1Represents the local host, ensuring that requests are forwarded internally to the correct application.
Reverse proxy address for multiple AnQiCMS application instances.
In certain advanced scenarios, or for the purpose of independent management and resource isolation, you may want to run on the same serverMultiple independent AnQiCMS application instancesEach instance is dedicated to serving one or several websites. The documentation mentions that, 'Each AnQiCMS needs to occupy a port, the default port is 8001, if you want to install multiple AnQiCMS on the same server, you need to allocate a different port for each project, the port is written inconfig.jsonWithin, editconfig.jsonTo define different ports.
In this case, each AnQiCMS application instance needs to configure aunique portFor example, the first instance listens on 8001, the second instance listens on 8002, the third instance listens on 8003, and so on.Correspondingly, each domain's proxy address configured in the reverse proxy needs to be accurately pointed to the port of its corresponding AnQiCMS instance.
For example, for a servicesiteA.comof the AnQiCMS instance (listening on port 8001), its reverse proxy address will behttp://127.0.0.1:8001. As for the servicesiteB.comof the AnQiCMS instance (listening on port 8002), the reverse proxy address then needs to be filled in ashttp://127.0.0.1:8002.
Whether configured through Baota panel, 1Panel, or aaPanel, the core principle is consistent: forward external requests to the internal IP address and listening port where the AnQiCMS application is actually running.
Summarize the key points.
In summary, when you configure the AnQiCMS multi-site reverse proxy, the key points of the proxy address are two:
first, IP addressIt is usually127.0.0.1It indicates that the AnQiCMS application and the reverse proxy service are on the same server.If your AnQiCMS application is deployed on the intranet IP of another server, it should be replaced with the corresponding intranet IP address.
secondly,Port numberThe port must be consistent with the actual port that the AnQiCMS application is listening on.By default, it is 8001, but if you have multiple independent AnQiCMS application instances, or you have manually changed its listening port, you need to fill in the actual effective port.
Fill in the proxy address accurately, which is the basis for ensuring that your AnQiCMS multi-site can run efficiently and stably.
Frequently Asked Questions (FAQ)
1. What should I fill in as the proxy address if my AnQiCMS application is not on the same server?
If the AnQiCMS application is deployed on a machine different from the reverse proxy server, you need to replace127.0.0.1with the server where the AnQiCMS application is locatedLocal IP address(if both are within the same local network) orPublic IP address(If you need to access across the network but for security reasons, it is usually recommended to use a local network IP). For example, if AnQiCMS is running on an IP address of192.168.1.100on the server and listening on port 8001, then the proxy address will behttp://192.168.1.100:8001.
2. How can I determine which port AnQiCMS is listening on?
The listening port of the AnQiCMS application is usually located in the installation directory underconfig.jsonthe file. You can find and open this file, and look forportOr similar keywords to confirm the current listening port. In addition, you can also use in Linux systems.lsof -i:<port_number>Command to check the occupation of a specific port, or view the startup log of the AnQiCMS application to confirm the port it is listening on.
3. What is the difference between "Multi-site management" of AnQiCMS and running "multiple AnQiCMS application instances"? What impact does it have on the filling of proxy addresses?
AnQiCMS's 'Multi-site Management' is a systemBuilt-in functionAllow you to manage and publish the content of multiple independent domain names within an AnQiCMS application instance. In this case, regardless of how many domain names there are, the reverse proxy only needs to forward all requests to thisSingle AnQiCMS application instance listening port(usually)http://127.0.0.1:8001Distributed internally by AnQiCMS according to the domain name of the request to the corresponding site.
Running "multiple AnQiCMS application instances" means you have started them on the serverMultiple AnQiCMS programsEach program is completely independent, may correspond to one or more sites. In this case, each AnQiCMS application instance needs oneindependent listening portTherefore, each domain's reverse proxy needs to point to the specific port that the AnQiCMS instance is listening on, such as,site1.comproxy tohttp://127.0.0.1:8001,site2.comproxy tohttp://127.0.0.1:8002)。Choose the way based on your specific needs, resource isolation strategy, and management complexity considerations.