View code
Print code help
01.server
{
02.listen
80;
03.server_name
example.com;
04.
05.root
/var/data/www;
06.index
index.html index.php;
07.
08.location
/pa {
09.alias /var/data/phpmyadmin;
10.index
index.html index.php;
11.}
12.
13.location
~ /pa/.+.php.*$ {
14.if ($fastcgi_script_name
~ /pa/(.+.php.*)$) {
15.set $valid_fastcgi_script_name
$1;
16.}
17.fastcgi_pass
127.0.0.1:9000;
18.fastcgi_index
index.php;
19.fastcgi_param
SCRIPT_FILENAME /var/data/phpmyadmin/$valid_fastcgi_script_name;
20.include
fastcgi_params;
21.}
22.
23.location
~ .+.php.*$ {
24.fastcgi_pass
127.0.0.1:9000;
25.fastcgi_index
index.php;
26.fastcgi_param
SCRIPT_FILENAME $document_root/$fastcgi_script_name;
27.fastcgi_param
SCRIPT_FILENAME $request_filename;
28.include
fastcgi_params;
29.}
30.}
2. Method 3: Introduction: View at zhigang.net The creative method I came up with is to add two server fields to one site, and then implement it through reverse generation.
Specific: The method is creative and a little troublesome.
The above introduces the configuration of Nginx directory alias Alias to support PHP, including the relevant content. I hope it will be helpful to friends who are interested in PHP tutorials.