Home > Backend Development > PHP Tutorial > nginx modifies website root directory

nginx modifies website root directory

WBOY
Release: 2016-07-29 08:56:13
Original
1146 people have browsed it
The default website root directory is /usr/local/nginx/html, change it to /home/www

vi /usr/local/nginx/conf/nginx.conf

Change the

location / {

root html;

index.php tm; }

changed to

location / {

root /home/www;

index index.php index.html index.htm; }

Then location ~ .php$ {

root html;

fastcgi_pass 127.0.0.1:9000;

fastcgi_index index.php; cgi_script_name;

include fastcgi_params; changed to

location ~ .php$ { root

/home/www;

fastcgi_pass

127.0.0.1:9000;

fastcgi_index index.php;

fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;

include fastcgi_params;

} The above introduces nginx to modify the website root directory, including the relevant content. I hope it will be helpful to friends who are interested in PHP tutorials.

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template