官术网_书友最值得收藏!

How it works...

For the most part, the configuration is the same as the static website configuration in Chapter 1, Let's Get Started. For the root URL call, we have a new try_files directive, which will attempt to load the files in the order specified, but will fall back to the last parameter if they all fail.

For this WordPress example, it means that any static files will be served if they exist on the system, then fall back to /index.php?args if this fails.

The args rewrite allows the permalinks of the site to be in a much more human form. For example, if you have a working WordPress installation, you can see links such as the one shown in the following screenshot:

Lastly, we process all PHP files via the FastCGI interface to PHP-FPM. In the preceding example, we're referencing the Ubuntu/Debian standard; if you're running CentOS/RHEL, then the path will be /var/run/php-fpm.sock.

NGINX is simply proxying the connection to the PHP-FPM instance, rather than being part of NGINX itself. This separation allows for greater resource control, especially since the number of incoming requests to the web server doesn't necessarily match the number of PHP requests for a typical website.

主站蜘蛛池模板: 奉贤区| 曲沃县| 浦江县| 阳西县| 德州市| 洮南市| 裕民县| 大足县| 天长市| 河西区| 余庆县| 那坡县| 五大连池市| 哈尔滨市| 周至县| 张家港市| 通道| 秭归县| 陇南市| 宁海县| 师宗县| 密山市| 汝城县| 八宿县| 孟连| 逊克县| 揭阳市| 广宁县| 达日县| 阿巴嘎旗| 枞阳县| 西安市| 蒙自县| 万源市| 科尔| 石林| 乌苏市| 尼勒克县| 建湖县| 石楼县| 开远市|