1.前提
已安装配置好nginx+ftp服务
2.配置Nginx 服务器
2.1进入nginx 配置文件目录:
cd /usr/local/nginx/conf
vim nginx.conf
2.2 修改配置文件:有两种方式
①方式一:在配置文件server{}中location /{} 修改配置
1 #默认请求
2 location / {
3 root /home/ftpuser/www;#定义服务器的默认网站根目录位置
4 index index.html index.php index.htm;#定义首页索引文件的名称
5 }
②方式二:在http{}内配置新服务
server {
listen 8080;
server_name localhost;
#charset utf-8;
#access_log logs/host.access.log main;
#默认请求
location / {
root /home/ftpuser/www;#定义服务器的默认网站根目录位置
index index.html index.php index.htm;#定义首页索引文件的名称
}
}