- NGINX Cookbook
- Tim Butler
- 201字
- 2021-07-03 00:04:23
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.
- 嵌入式軟件系統(tǒng)測(cè)試:基于形式化方法的自動(dòng)化測(cè)試解決方案
- JavaScript修煉之道
- Mastering Natural Language Processing with Python
- oreilly精品圖書:軟件開發(fā)者路線圖叢書(共8冊(cè))
- Learning AWS Lumberyard Game Development
- Magento 2 Development Cookbook
- The HTML and CSS Workshop
- Node Cookbook(Second Edition)
- Mastering React
- 區(qū)塊鏈技術(shù)進(jìn)階與實(shí)戰(zhàn)(第2版)
- Android傳感器開發(fā)與智能設(shè)備案例實(shí)戰(zhàn)
- ActionScript 3.0從入門到精通(視頻實(shí)戰(zhàn)版)
- Mastering JavaScript
- Java Web開發(fā)教程:基于Struts2+Hibernate+Spring
- Getting Started with RethinkDB