Using domain name to access the site under Windows
If you need to access the security CMS site using a domain name under Windows, you need to rely onNginx
. If not necessary, there is no need to go through the trouble.
If you are running AnQi CMS locally and pushing static files to the server to use as a static website, please follow the steps below.
- In PHPStudy, start Nginx, switch to the website tab, and create a website. Fill in the domain name in the domain column, such as
dev.anqi.com
The root directory should be left as the default generated one, do not check the checkbox.PHP
No need to fill in other places. Click Confirm to complete the site creation. - Switch to the Settings tab, switch to the configuration file, find
vhosts.conf
Tab, find the corresponding configuration file in the list, such as the one just generateddev.anqi.com_80
Click to open. - Modify
root
Add,/public
Result:
root "C:/phpstudy_pro/WWW/dev.anqi.com/public";
- Found
location /
, Add the pseudo-static configuration of AnQin CMS before it:
location @AnqiCMS {
proxy_pass http://127.0.0.1:8001;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
Inlocation /
the next line, add the following configuration:
try_files $uri $uri/index.html @AnqiCMS;
Deletelocation /
The default configuration of the second last line:
include C:/phpstudy_pro/WWW/dev.anqi.com/public/nginx.htaccess;
Return to the PhpStudy homepage, restart Nginx, and a new site is set up. Open the domain name in the browser.
Start installing AnQi CMS
Copy the installation package to the root directory of the websiteC:/phpstudy_pro/WWW/dev.anqi.com
And extract it. Double-click to runanqicms.exe
Enter the database information in the installation interface of the opened browser, as this time a domain name has been set, so fill in the network address in the URL fieldhttp://dev.anqi.com
and click the install button.