As an experienced CMS website operation personnel of an enterprise, I know that the core value of a content management system lies in the efficient and convenient management of content, and the stability and secure access of the website backend is the foundation of all this.For users who install AnQi CMS through Docker on Baota panel, how to smoothly access the background management interface through a custom domain is a crucial step to ensure the smooth operation of daily operations.
AnQi CMS is developed using Go language, and it is favored for its high performance and security.Deploying Anqiz CMS in Baota Docker environment, the usual process has encapsulated the core services inside containers and provides services to the outside through specific ports.By default, AnQi CMS runs in a Docker container8001Port. It is particularly important for the reverse proxy feature of Baota panel to allow external domains to access this internal service.
Ensure that Anqi CMS has been deployed in Baota Docker.
Firstly, we need to confirm that the Anqi CMS has been successfully installed and running through the Baota panel's Docker app store.During the installation process, you may have already filled in the "website domain" and "port" information in the configuration interface of the Docker application.For example, enter your main domain namedev.anqicms.comEnter the website domain and specify the container port as8001. The Baota panel's Docker app store will usually automatically create a reverse proxy site associated with the domain name under the "Website" menu when installing AnQiCMS.This is the key step to ensure that the domain name can directly point to the AnQiCMS service inside the Docker container.
Configure the website and reverse proxy of the Baota panel
Even if Baota automatically configures reverse proxy when installing Docker applications, we should also understand its working principle and how to check or manually adjust it.
You need to access the left menu of the Baota panel, select the 'Website' function. Here, you should see a domain set for Anqi CMS (for exampledev.anqicms.comThe corresponding website entry. If the site does not exist, or if you need to bind other domains to this AnQiCMS instance, you can create it by clicking "Add Site" or "Reverse Proxy".
The most core configuration when creating or editing a reverse proxy site is "target URL". Since AnQiCMS runs in a Docker container inside8001Port, and Docker containers usually access services on the host machine through127.0.0.1(i.e., the local loopback address), therefore, it is necessary to set the target URL tohttp://127.0.0.1:8001. This tells Baota panel that when external users access through your domain, the request should be forwarded to the local8001port, which is the Docker container where the Anqi CMS is located.
After completing these configurations, please make sure to click the "OK" or "Save" button and ensure that your domain has been correctly resolved to the server's IP address.
Visit the AnQiCMS backend management interface
Once the domain resolution and Baota panel reverse proxy configuration are correct, you can access through your bound domain plus/system/How to access the Anqi CMS backend management interface.
For example, if your domain ishttp://dev.anqicms.com/then the backend access address ishttp://dev.anqicms.com/system/. Enter this address in the browser and you will see the Anqicms login interface. After the first installation, you may need to perform initial settings or use the default administrator accountadminand password123456Log in (strongly recommended to change the default password immediately after login to enhance security).
Enhance backend security: customize the backend domain name
The AnqiCMS v2.1.1 and later versions provide a feature to enhance backend security: Custom backend domain.This feature allows you to specify an independent backend access domain within the Anqi CMS system.This means that even through the main domain/system/You can access the backend login page, but if the system is configured with a custom backend domain, you can only access the backend through that specific domain.
To enable this feature, you need to go to the "Global Function Settings" under the "Background Settings" after successfully logging in to the Anqi CMS background. Here, find the "Background Domain Address" option and enter the domain name you want to use specifically for accessing the background, for example,https://admin.anqicms.comPlease note that before configuring this domain in the AnQi CMS backend, you must ensure that the domain has been resolved to the server IP, and that the corresponding website and reverse proxy have also been configured in the Baota panel, pointing to the port of the AnQi CMS Docker container.This can effectively limit the background entry and further enhance the security of the website.
Frequently Asked Questions (FAQ)
What is the reason why I configured the reverse proxy, but encountered a 502 error when accessing the backend through the domain name?Answer: 502 Bad Gateway error usually indicates that Baota's reverse proxy failed to successfully connect to the AnQiCMS Docker service on the backend. You need to check several aspects:
- Confirm that the AnQiCMS Docker container is running. You can check the container status under the "Docker" menu in the Baota panel.
- Check if the target URL of the reverse proxy is correct. Make sure it points to
http://127.0.0.1:8001(or the port that your AnQiCMS container is actually listening on). - Confirm that the AnQiCMS container port is not occupied by other services on the host. You can use SSH terminal to
lsof -i:8001Command (replace 8001 with your port) to check port usage. - Check if the Nginx or Apache pseudo-static rules are correctly configured for the domain in the Baota panel, although Docker installation usually handles it automatically, but sometimes manual verification is still required.
Ask: How should I configure if my AnQiCMS Docker container port is not the default 8001?Answer: If you customized the port (such as 8002) during the AnQiCMS Docker container installation, then when configuring the reverse proxy on the Baota panel, the target URL should also be changed accordingly.http://127.0.0.1:8002In addition, if you have set a custom backend domain in the "Global Function Settings" of AnQiCMS and the domain needs to use a different port, you also need to make sure that Baota's reverse proxy points to the correct port.
Ask: What is the difference between the "Custom Backend Domain" feature in the Anqi CMS backend and Baota reverse proxy?Answer: Baota's reverse proxy forwards external domain requests to the internal Docker service port at the server level, it is to implement domain access to Docker containersinfrastructure layerconfiguration. And the "custom backend domain" function of the Anqi CMS backend isapplication layerThe configuration, it tells AnQiCMS application, only respond to backend access requests from specific domain names.This means that even though other domain names can be successfully forwarded to AnQiCMS through Baota's reverse proxy, if AnQiCMS has set up a custom backend domain internally, requests from non-specified domains will not be able to enter the backend interface, thereby providing additional security protection.In simple terms, reverse proxy allows your domain name to 'find' AnQiCMS, while a custom backend domain allows AnQiCMS to only 'recognize' specific domains as backend entry points.