Sometimes we want to install phpmyadmin and do not want to put the phpmyadmin file in the root directory of the website. We can use the virtual directory to solve this problem.
The code is as follows: |
Copy code |
# Phpmyadmin virtual directory Location/pma { Alias/web/htdocs/phpmyadmin; Index index.html index.htm index. php; } # Php support for virtual directories Location ~ ^/Pma/. +. php $ { Rewrite/pma (/. *. php ?) $1 break; Root/web/htdocs/phpmyadmin; Fastcgi_pass 127.0.0.1: 9000; Fastcgi_index index. php; Include fastcgi. conf; } |
Alias
The code is as follows: |
Copy code |
Location/abc/ { Alias/home/html/abc /; }
|
In this section, http: // test/abc/a.html specifies/home/html/abc/a.html. This configuration can also be changed
Root
The code is as follows: |
Copy code |
Location/abc/ { Root/home/html /; }
|
The/a/directory must have a hello directory; otherwise, an error is returned.
If it is not in the location command, it specifies the root object of a website.
Alias: this is an alias that defines the alias of the above file or directory
Root: specifies the parent directory of a directory, for example:
Locate/hello /{
Root//;
}
The/a/directory must have a hello directory; otherwise, an error is returned.
If it is not in the location command, it specifies the root directory of a website.
In addition, "/" must be added after the directory name when using alias.