更改nginx网站根目录
2017-06-05 12:38
260 查看
默认网站根目录为/usr/local/nginx/html,要将它改成/homw/www
vi /usr/local/nginx/conf/nginx.conf
将其中的
location / {
root html;
index index.php index.html index.htm;
}
改为
location / {
root /home/www;
index index.php index.html index.htm;
}
然后再将
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;
}
改为
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;
}
已经安装了samba,所以要将vi /etc/samba/smb.conf中的[public](在配置文件的最下面)下的path值改为
path = /home/www/
最后然后重启nginx
搞定!
vi /usr/local/nginx/conf/nginx.conf
将其中的
location / {
root html;
index index.php index.html index.htm;
}
改为
location / {
root /home/www;
index index.php index.html index.htm;
}
然后再将
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;
}
改为
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;
}
已经安装了samba,所以要将vi /etc/samba/smb.conf中的[public](在配置文件的最下面)下的path值改为
path = /home/www/
最后然后重启nginx
搞定!
相关文章推荐
- 如何更改nginx网站根目录 以及解析php
- Nginx网站根目录更改及导致403 forbidden的问题解决
- Nginx 更改网站根目录教程 - 顺便解决403 Forbidden | File not found
- 更改nginx网站根目录
- nginx更改网站目录,端口等等的方法
- Nginx网站根目录更改及导致403 forbidden的问题解决
- 更改Nginx网站根目录以及导致的403 forbidden问题解决
- 更改nginx网站根目录
- 更改nginx网站根目录
- 更改nginx的网站根目录
- Amh/Nginx更改网站根目录
- 更改nginx网站根目录
- nginx服务器更改网站根目录
- 如何更改nginx网站根目录
- Amh/Nginx更改网站根目录
- 更改Nginx网站根目录以及导致的403 forbidden问题解决
- nginx更改网站目录,端口等等的方法
- Tomcat中更改网站根目录和默认页的配置方法
- 阿里云安装LNMP以及更改网站文件和MySQL数据目录
- Nginx对某个目录或整个网站进行登录认证的方法