AnQiCMS is an enterprise-level content management system developed based on the Go language, which, with its high efficiency, security, and ease of use, has become an ideal choice for small and medium-sized enterprises and content operation teams.Combine 1Panel, a convenient server management panel, deploying AnQiCMS through Docker containers can greatly simplify the installation and maintenance process.In order for AnQiCMS to access via a custom domain name and hide its internal running port, configuring reverse proxy is an essential step before the website goes into operation.This guide will detail how to configure reverse proxy for AnQiCMS deployed under the 1Panel environment.
Ensure that your server has successfully installed the 1Panel management panel before starting configuration.1Panel provides a convenient app store, where you need to install OpenResty (as a web server) and MySQL (as a database service), both of which are essential for AnQiCMS to run.If 1Panel has not been installed yet, please refer to its official documentation to complete the installation.
Deploy AnQiCMS Docker Container
In the 1Panel management interface, navigate to the "ContaineranqicmsIn the "Mirroranqicms/anqicms:latest.
About port configuration, select "Expose Port", and set both the "Server Port" and "Container Port" to8001Here is something to note. If you plan to run multiple AnQiCMS instances on the same server, each instance's 'server port' should be set to a different, unused value (for example,8002/8003),but its corresponding "container port" should still be maintained.8001,because this is the service listening port inside the AnQiCMS container.
Continue scrolling down, select 'Restart on failure' or 'Restart if not manually stopped' under 'Restart policy' to ensure the service can recover automatically after an abnormal exit.Complete the above configuration and click the "Confirm" button to create and start the AnQiCMS container.
Configure AnQiCMS reverse proxy site
Successfully created AnQiCMS container, next you need to configure reverse proxy in 1Panel to access it through the domain name you set up.In the 1Panel left menu, click the "Website
In the pop-up interface, select the 'Reverse Proxy' type. In the 'Main Domain' field, enter the domain name you wish to use to access AnQiCMS, for exampletest.anqicms.com. Make sure that this domain has been correctly resolved to your server IP address. In the "Proxy Address" field, enter127.0.0.1:8001.127.0.0.1stands for the local loopback address of the server.8001This is the 'server port' exposed to the outside when you create a Docker container.If you have previously set different server ports for multiple AnQiCMS containers, please make sure to fill in the port here matches the actual 'server port' of the AnQiCMS container you want to proxy.Finally, click the "Confirm" button to complete the creation of the reverse proxy site.
Complete the initialization installation of AnQiCMS
After the reverse proxy configuration is completed, you can access the domain name you have set through the browser, for examplehttp://test.anqicms.com/.Now, AnQiCMS will guide you to the initial installation interface.Enter database information according to the prompt (make sure it matches the MySQL configuration installed in the 1Panel App Store), set the background administrator account and password, and confirm the website address.Complete these steps and AnQiCMS will run normally./system/for examplehttp://test.anqicms.com/system/. Please make sure to keep your backend account information safe.
Through the combination of 1Panel and Docker to deploy AnQiCMS and configure reverse proxy, not only does it simplify the technology stack and improve the deployment efficiency, but it also provides a unified entry and basic security guarantee for the host.This deployment method allows website operators to focus more on content creation and business development, without the need to delve into complex server configuration.
Common Questions and Answers (FAQ)
Question: Why do I need to configure a reverse proxy?
Answer: Configuring a reverse proxy allows you to access it through a custom domain (such asyourdomain.com而不是 IP 地址和端口号(例如192.168.1.1:8001To access AnQiCMS.This not only improves the user experience, makes the website address more professional, but also can hide the internal service port to a certain extent, increase security, and lay a foundation for advanced features such as HTTPS configuration, load balancing, CDN acceleration, and more in the future.
问: 如果我安装了多个 AnQiCMS 容器,反向代理如何配置?
答: When you install multiple AnQiCMS Docker containers, each container needs to expose a unique 'server port' in 1Panel (for example,8001,8002,8003),while the internal port of the container usually can be maintained as8001. When configuring reverse proxy in 1Panel, you need to create a separate website for each AnQiCMS instance, and make sure that the 'proxy address' of each website points to the corresponding 'server port' of the instance (for example,127.0.0.1:8001Corresponding to the first instance,127.0.0.1:8002Corresponding to the second instance),using different main domain names or subdomain names to distinguish access.
问: After configuring reverse proxy, if the website access fails, how should I troubleshoot?
答: First, check if your domain name resolution is correctly pointing to the server IP.Then, confirm whether the AnQiCMS Docker container in 1Panel is running normally, you can check the status and logs through the container management interface of 1Panel.Then, check if the 'Proxy Address' port in the reverse proxy configuration is completely consistent with the 'Server Port' exposed by the Docker container.80⁄443Port, as well as the ports exposed by the container.Finally, you can view the website logs and container logs of 1Panel, which usually provide detailed error information to help you diagnose the problem.