【转】通过HTTP服务访问FTP服务器文件(配置nginx+ftp服务器)

通过HTTP服务访问FTP服务器文件(配置nginx+ftp服务器)

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;#定义首页索引文件的名称  
           }  
        }

猜你喜欢

转载自blog.csdn.net/Tdh5258/article/details/82713835