nginx+php configuration is relatively simple, the core is a word----
Forward the requested information to the 9000-port PHP process,
Let the PHP process handle the PHP file under the specified directory.
Here's an example:
Location ~ \. php$ { // root html; Fastcgi_pass 127.0.0.1:9000; Fastcgi_index index. php; Fastcgi_param script_filename $document _root$fastcgi_script_name; include fastcgi_params; }
1: Encountered PHP file,
2: Locate the root directory to HTML,
3: Transfer the request context to the 9000 port PHP process,
4: And tell the PHP process that the current script is $document _root$fastcgi_scriptname
Configure Nginx support PathInfo so that the/NEWS/1 of the TP framework can be supported
Location ~ \.php (. *) $ { // root directory rooted html; Fastcgi_pass 127.0.0.1:9000; Fastcgi_index index. php; Fastcgi_param script_filename $document _root$fastcgi_script_name; Fastcgi_param path_info $1; include fastcgi_params; }
Configuring Nginx overrides (using regular expressions)
Try_files method Implementation Overrides
means that
Let's try this directory for/goods/1/.
Try again, there's no/goods/1 this file.
Finally try/index.php?goods/1 this URL
Configuration of the nginx+php