Nginx作為文件服務器

配置fileserver.conf

server {

listen      1234;

server_name  192.168.0.240;

#charset koi8-r;

#ccess_log  logs/host.access.log  main;

charset utf-8; # 避免中文亂碼

root E:/FTP_ROOT; # 存放文件的目錄

location / {

autoindex on; # 索引

autoindex_exact_size off; # 顯示文件大小。如果為on,則顯示文件的原始大小(bytes)

autoindex_localtime on; # 顯示文件時間

}

error_page  404 /404.html;

location = /404.html {

root  html;

}

# redirect server error pages to the static page /50x.html

#

error_page  500 502 503 504 /50x.html;

location = /50x.html {

root  html;

}

# proxy the PHP scripts to Apache listening on 127.0.0.1:80

#

#location ~ \.php$ {

#    proxy_pass  http://127.0.0.1;

#}

# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000

#

#location ~ \.php$ {

#    root          html;

#    fastcgi_pass  127.0.0.1:9000;

#    fastcgi_index  index.php;

#    fastcgi_param  SCRIPT_FILENAME  /scripts$fastcgi_script_name;

#    include        fastcgi_params;

#}

# deny access to .htaccess files, if Apache's document root

# concurs with nginx's one

#

#location ~ /\.ht {

#    deny  all;

#}

}

查看效果

效果圖
最后編輯于
?著作權歸作者所有,轉載或內容合作請聯系作者
平臺聲明:文章內容(如有圖片或視頻亦包括在內)由作者上傳并發布,文章內容僅代表作者本人觀點,簡書系信息發布平臺,僅提供信息存儲服務。

推薦閱讀更多精彩內容