As an experienced security CMS website operation personnel, I am fully aware of the importance of correctly configuring reverse proxy in complex website architectures, especially when it involves multi-site management.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 the crucial 'proxy address' should be filled in for the multi-site reverse proxy configuration in AnQiCMS.
Understanding the connection mechanism between reverse proxy and AnQiCMS
Before starting the configuration, we first need to understand the role of reverse proxy in the 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 the outside, then forwards these requests to the internal backend services according to preset rules, and returns the responses of the backend services to the user.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 port 80 or 443) to the port that AnQiCMS is actually listening on.
AnQiCMS as a CMS system developed based on the Go language, after deployment, it will default to listen on a 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 AnQiCMS application instanceThrough its built-in "Multi-site Management" feature to host multiple domain websites, 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 AnQiCMS application is listening on.
通常,如果AnQiCMS应用程序与您的反向代理服务器运行在同一台机器上,那么代理地址应该填写为本地回环地址127.0.0.1Add the AnQiCMS listening port. For example, if AnQiCMS is running on the default port 8001, then the proxy address should be filled in as:
http://127.0.0.1:8001
Here are the127.0.0.1Represents the local host, ensuring that requests are internally routed to the correct application on the server.
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 serves one or several websites. The document states, '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.jsonHere, editconfig.jsonTo define different ports.
In this case, each AnQiCMS application instance needs to be configured with aunique portFor example, the first instance listens on port 8001, the second instance listens on port 8002, the third instance listens on port 8003, and so on.Correspondingly, the proxy address configured for each domain in the reverse proxy needs to accurately point to the port of its corresponding AnQiCMS instance.
For example, for a servicesiteA.comThe AnQiCMS instance (listening on port 8001), its reverse proxy address will behttp://127.0.0.1:8001. And for the servicesiteB.comThe AnQiCMS instance (listening on port 8002), the reverse proxy address needs to be filled in ashttp://127.0.0.1:8002.
Whether it is 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 key points
In summary, when you configure the AnQiCMS multi-site reverse proxy, the key points for the proxy address are two:
Firstly,IP AddressIt is usually127.0.0.1,表示EnglishCMS应用与反向代理服务在同一台服务器上。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 port that AnQiCMS application is actually listening on.By default, it is 8001, but if you have multiple independent AnQiCMS application instances, or if you manually change its listening port, you need to fill in the actual effective port.
Accurately fill in the proxy address to ensure the efficient and stable operation of your AnQiCMS multi-site.
Common Questions and Answers (FAQ)
1. If my AnQiCMS application is not on the same server, what proxy address should I fill in?
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 network IP address(if both are within the same local area network) orPublic IP addressIf access across the network is required but for security reasons it is usually recommended to use the internal network IP). For example, if AnQiCMS is running at IP 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?
AnQiCMS application's listening port is usually configured in theconfig.jsonfile in its installation directory. 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>Check the occupation status of a specific port using a command, 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 instances of AnQiCMS applications"? How does it affect the filling of the proxy address?
AnQiCMS的“multi-site management”是系统built-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 thisAn instance of a single AnQiCMS application listens on this port(usually)http://127.0.0.1:8001),is distributed to the corresponding site according to the domain name requested by AnQiCMS.
Running 'multiple AnQiCMS application instances' means that you have startedmultiple AnQiCMS programsEach program is completely independent, possibly corresponding to one or more sites. In this case, each AnQiCMS application instance requires onean independent listening portTherefore, each domain's reverse proxy needs to point to the specific port that the corresponding AnQiCMS instance is listening on (for example,site1.comproxy tohttp://127.0.0.1:8001,site2.comproxy tohttp://127.0.0.1:8002)。Choose which way depends on your specific needs, resource isolation strategy, and management complexity considerations.