Junge's LNMP one-click installation package has always been my preferred installation environment for small-memory VPS because it takes up less resources and has high performance. The latest release of lnmp0.7 also adds support for LNMPA. LNMPA uses Nginx as the front-end service to provide faster and more timely static pages, js, pictures, etc. when customers When the client requests access to a dynamic page, Nginx's reverse proxy is sent to Apache for processing. After Apache processes it, it is handed over to Nginx and returned to the client. Using LNMPA can better solve the 502 errors caused by PHP-FPM in the LNMP architecture, while providing a more secure multi-user and multi-site environment.
As we all know, LNMP has added pseudo-static support for Discuz, Wordpress, Sablog, emlog, dabr, etc. by default. When creating a new virtual host, entering the above name will provide perfect pseudo-static support for the above programs. If you also need to add a custom pseudo-static rule, directly enter the name of the pseudo-static rule you want, and then edit /usr/local/nginx/conf/your custom pseudo-static name.conf to add the pseudo-static rule. .
In Brother Jun’s introduction, he wrote about the issue of pseudo-static rules for new virtual hosts. However, a friend asked me: When I installed the LNMP environment, I already entered the domain name. I want to use this domain name to build a website. Where are the pseudo-static rules for this written? Okay, today, I will mainly talk about this issue.
Let’s take DiscuzX1.5 (or X2) as an example to talk about how to write pseudo-static in the default directory and where to write it.
Since LNMP comes with DiscuzX’s pseudo-static rules by default (all pseudo-static rule files are in the .conf file named after the program in the /usr/local/nginx/conf/ directory), we do not need to create a new pseudo-static rule file. The pseudo-static rule file of DiscuzX1.5 is discuzx.conf.
What we need to do next is to modify the default virtual host in nginx.conf. The specific method is to add include discuzx.conf; to the server, as shown in the picture:
In the picture, the one in my box This is the pseudo-static rule we added, which is to add a line under root /home/wwwroot;: include discuzx.conf;, then save and upload.
After the modification is completed, don’t forget to restart nginx, command:
/usr/local/nginx/sbin/nginx -s reload