Configure reverse proxy for AnQi CMS in the 1Panel environment
AnQi CMS is an enterprise-level CMS developed based on Go language, with its high efficiency, security, and SEO-friendly features, it has become an ideal choice for small and medium-sized enterprises and content operation teams.After deploying AnQiCMS through Docker in the 1Panel environment, configuring reverse proxy is an essential step to allow external users to access your website through a domain name rather than through the server IP and port.This not only provides a more professional user experience, but also helps with subsequent SSL certificate configuration and SEO optimization.
Deploy AnQiCMS Docker container
Before configuring the reverse proxy for AnQiCMS, first make sure that your AnQiCMS container has successfully run in the 1Panel environment.If you have not completed this step, please log in to the 1Panel panel first.
First, you need to access the 'Container' option in the left menu of 1Panel and switch to the 'Container' tab.Click the "Create Container" button here to start the AnQiCMS deployment process.In the pop-up configuration interface, specify an easily recognizable name for your container, such as "anqicms".anqicms/anqicms:latestIt will pull the latest version of AnQiCMS image from Docker Hub.
Next, in the port setting section, select "Expose Port". It is recommended to fill in both the server port and the container port.8001. If you plan to deploy multiple AnQiCMS containers on the same server, each new container's server port should be set to a different value (for example8002/8003But the internal port of the container still remains8001Unchanged because this is the default port listened to by AnQiCMS.
Continue scrolling down, in the restart rules section, you can choose 'restart after failure' or 'restart if not manually stopped' according to your operational strategy to ensure that the AnQiCMS service can recover automatically after an unexpected interruption.After all the configurations are completed, click the "Confirm" button, 1Panel will start creating and launching the AnQiCMS container.Please wait a moment until the container status shows running.
Configure reverse proxy site
After the AnQiCMS container runs successfully, the next step is to associate your domain with the container so that it can be accessed through standard HTTP/HTTPS ports.This is the role of reverse proxy.
In the left navigation bar of the 1Panel panel, click the "Website" option, and then select the "Website" tab.Here, click the “Create Website” button and select “Reverse Proxy” from the pop-up options.
In the reverse proxy configuration interface, you need to enter your main domain name, for exampleyourdomain.comortest.anqicms.comThis domain should be the public domain you have resolved to the current server IP. Fill in the "Proxy Address" field.127.0.0.1:8001. Here,127.0.0.1represents the local server, and8001It is the port exposed by your AnQiCMS container.If you used a different server port when deploying containers, please make sure to fill in the correct port corresponding to your AnQiCMS container.
After checking for accuracy, click the "Confirm" button to complete the creation of the site. 1Panel will automatically generate and configure the Nginx reverse proxy rules, forwarding all requests to the AnQiCMS container for your domain.8001on the port.
Visit and initialize your AnQiCMS website
You have successfully configured reverse proxy for AnQiCMS in the 1Panel environment. Now, you can enter the domain name you have configured in the browser, for examplehttp://yourdomain.com/. If it is your first visit, AnQiCMS will guide you to the initial installation interface, where you can set up database information, administrator account and password according to the prompts.
After the installation is complete, your website can run normally. When you need to access the back-end management interface, please add/system/Path, for examplehttp://yourdomain.com/system/to the domain name to log in and start managing your AnQi CMS content.
Frequently Asked Questions (FAQ)
1. After configuring the reverse proxy, when accessing the domain, the blank page or error page is displayed. How should I troubleshoot?
First, please check if your AnQiCMS Docker container is running normally, you can check the container status through the 'Container' page of 1Panel. Second, confirm that the 'Proxy Address' in your reverse proxy settings is correctly pointing to the server port exposed by the AnQiCMS container, usually as127.0.0.1:8001If everything is fine, please check if your domain name resolution has taken effect and is pointing to the current server IP, as well as whether the server firewall allows it80and443External access to the port (if SSL is configured). You can also view the reverse proxy log for the website in 1Panel, which usually contains specific error information.
Why is it necessary to use a reverse proxy to access AnQiCMS instead of using the IP and port directly?
There are several major advantages to using a reverse proxy.Firstly, it allows you to access the website through a concise domain name instead of a complex IP address and port number, which is more in line with user habits and brand image.Secondly, reverse proxy is a key link in implementing SSL certificates (HTTPS encryption), which can encrypt and decrypt before external requests reach the AnQiCMS container, enhancing website security.In addition, reverse proxy can provide advanced features such as load balancing, caching, and hide the real port of the backend server, adding an extra layer of security.
How should reverse proxy be configured if I want to deploy multiple AnQiCMS websites on the same server?
Deploy multiple AnQiCMS websites on the same server, each AnQiCMS container needs to be mapped to a different server port (for example, the first one is8001, the second one is8002and so on).Then, create a reverse proxy site for each AnQiCMS website separately in the 1Panel and bind an independent domain name to each site.127.0.0.1The server port corresponding to the AnQiCMS container (for example, the first domain is proxy to127.0.0.1:8001, the second domain is proxy to127.0.0.1:8002This way, different domain requests will be correctly forwarded to their respective AnQiCMS container instances.