As an experienced security CMS operator, I fully understand your needs for website deployment and domain binding.The AnQi CMS, with its efficient and flexible features, can greatly simplify operations through Docker deployment.Now, let's delve into how to configure reverse proxy to bind your domain through Baota panel (aaPanel) after deploying Anqi CMS on Docker, ensuring your website goes live smoothly and runs stably.
How to configure reverse proxy to bind my domain after deploying AnQiCMS with Docker?
In the digital age, binding your content management system with a dedicated domain is a key step in building a brand image and enhancing user experience.When your AnQiCMS (AnQiCMS) has been deployed on the server through a Docker container, the next step is to take advantage of the powerful reverse proxy feature of Baota panel (aaPanel) to correctly direct external domain requests to the running AnQiCMS service.
Preparation: Ensure that the AnQiCMS Docker container is running normally
Before starting to configure the reverse proxy, please ensure that you have installed Baota Panel on the server and that the AnQiCMS Docker container has been successfully started.In most cases, you can check the container status through the Docker management interface of Baota panel or directly in the terminal.AnQiCMS's Docker container listens by default8001Port. If you change this port during installation, please remember the custom port number, which is crucial for subsequent reverse proxy configuration.
Understand the role of reverse proxy.
In simple terms, a reverse proxy is like the 'gatekeeper' of your website.When the user enters your domain in the browser, the request will first reach the Baota panel.The Baota panel acts as a reverse proxy server and will receive these requests and forward them to the specific port (such as 8001) inside your AnQiCMS Docker container.The container processes the request and then returns the response to the Baota panel, which finally sends it to the user's browser.The benefits of this mechanism are multi-faceted, it not only allows you to run internal services on standard HTTP/HTTPS ports (80/443), but also provides additional security and performance advantages such as SSL encryption, load balancing, and hiding the real address of the backend service.
Configure reverse proxy for a single AnQiCMS site
If you plan to run an AnQiCMS site on the server and bind it to your domain, here are the detailed configuration steps in the Baota panel:
First, log in to your Baota panel. In the left menu bar, find and click thewebsiteoption. In the website management interface, you will see aReverse Proxylabel, click it, and then select theAdd Reverse ProxyButton.
In the pop-up "Add Reverse Proxy" configuration window, you need to fill in the following key information:
- Domain: Please enter the complete domain name you want to bind to, for example
www.yourdomain.comMake sure that the domain name has been correctly resolved to your server IP address. - Target URLThis is the address pointing to the internal service of your AnQiCMS Docker container. By default, the AnQiCMS container runs on
127.0.0.1:8001. Therefore, you should fill inhttp://127.0.0.1:8001If you previously configured a different port for the AnQiCMS Docker container, please change8001to the actual port number you are using.
After filling in, click theSubmitClick the button to complete the creation of the reverse proxy site. The Baota panel will automatically generate and configure the Nginx (or Apache, depending on your environment) reverse proxy rules for you.
Configure reverse proxy for multiple AnQiCMS sites
One of the major advantages of AnQiCMS is that it supports multi-site management, which means you canThe same AnQiCMS Docker containerRun multiple independent websites and bind different domain names to them. This method saves a lot of server resources. The following is the additional configuration required to achieve this goal:
First, in the “website” management interface, click on the “Add Site”. Select to create astaticorPHP project(Select static for the PHP version, and enter your new domain name, for exampledev.anqicms.com)。In the creation process, you can choose not to create FTP and databases. After the site is created,Please copy the root directory path generated by the sitewhich will be used in the next steps.
Continue, configure reverse proxy for this newly created site. Enter the new site's "setting" interface, switch to the "Reverse Proxy" tab, click "Add Reverse Proxy. It is similar to configuring a single site, still fill in the "Target URL".http://127.0.0.1:8001(or the actual port of your AnQiCMS Docker container).
After configuring the reverse proxy for a new site on the Baota panel, you need to go back to the new site's "setting" interface, click "site directory" tag. Change "Running directory" topublicClick “Save.
The most important step is toAnQiCMS backend management systemAdd this new site. Access the backend of your first (default) AnQiCMS site via its domain, find the "" function in the left menu, and click on it.Multi-site management" function, then click on it.Add a new siteIn the pop-up window, you need to fill in the detailed site information:
- Site name: Give your new site a name that is easy to recognize.
- Site root directoryThis item is very critical. Since AnQiCMS runs in Docker, all site caches and other data need to be stored independently. Please use
/app/Start by naming it according to your new domain name, and then replace the dots in the domain name (.) with underscores (_). For example, if your new domain name isdev.anqicms.comthen the site root directory can be set to/app/dev_anqicms_com. Make sure that this directory name is unique across all sites. - website address: Enter the full domain name of your new site, for example
http://dev.anqicms.com. - Administrator account password: Set up independent backend administration account and password for new site.
- Database name: Similarly, create a unique database name for your new site, for example
dev_anqicms_com. - Duplicate database informationDue to the deployment of AnQiCMS via Docker, and having full management permissions for the MySQL inside Docker, you usually choose to ... ... ... ...Reuse the default database account information, so there is no need to re-enter the username and password for the database.
- Select the template to use: Choose an appropriate template based on your needs.
Click “Confirm”Button, complete the creation of the new site. By now, your new site has already been successfully bound to the domain through reverse proxy and the multi-site function of AnQiCMS and can be accessed normally.
Start using your AnQiCMS website
After completing the above configuration, you can now enter the domain name you have bound (for examplehttp://www.yourdomain.com/orhttp://dev.anqicms.com/) to access your AnQi CMS website.
When you first visit, if your AnQiCMS has not been initialized, the system will guide you to the installation interface, follow the prompts to complete the database connection and administrator account settings.If you install AnQiCMS via the Baota Docker App Store with one-click installation, the website is usually pre-installed and provides a default administrator account (admin) and password (123456). It is recommended that you change these default credentials immediately after your first login to the backend to ensure website security.
Your AnQiCMS backend management address is usually:您的域名/system/For example,http://www.yourdomain.com/system/.
By following these detailed steps, you should be able to successfully bind the AnQiCMS instance deployed with Docker to your domain through the reverse proxy of Baota panel, whether it is a single site or multiple sites, they can run efficiently and safely.
Frequently Asked Questions (FAQ)
Why do I need to bind my domain through a reverse proxy instead of directly pointing the domain to the Docker container port?Directly pointing the domain to a non-standard port of the Docker container (such as 8001) is technically feasible, but it is not **practical**.Reverse proxy allows you to use standard HTTP (80) and HTTPS (443) ports, which is not only more user-friendly but also convenient for integrating SSL certificates.In addition, reverse proxy can centrally handle all incoming traffic, provide additional security layers, load balancing, caching, and other functions, and hide the real port of the backend service, enhancing the robustness and security of the system.
Can I run multiple websites with different domain names in an AnQiCMS Docker container?It's okay, this is one of the core advantages of AnQiCMS multi-site management function. You only need to configure a reverse proxy for each domain in the Baota panel and direct them all to the port of the same AnQiCMS Docker container (for example
http://127.0.0.1:8001). Then, in the AnQiCMS backend management system, through the "Multi-site Management" feature, add and configure these new domain names one by one, specify independent site root directories and databases, and AnQiCMS will automatically recognize and manage the content of these different websites.Configure reverse proxy and still cannot access the website with my domain, how should I investigate?First, make sure that your domain has been correctly resolved to the server's IP address.Next, check if ports 80 and 443 are allowed in the Baota panel.Then, verify that the reverse proxy's "target URL" is correctly pointing to the actual IP and port of the AnQiCMS Docker container (usually
http://127.0.0.1:8001)。Finally, check if the AnQiCMS Docker container is running normally.If the problem still exists, you can check the Nginx/Apache error logs of the Baota panel, or the AnQiCMS Docker container's runtime logs, which will usually provide more specific error information.