nginx做本地盘符映射,作为一个文件服务器使用

nginx做本地盘符映射,作为一个文件服务器使用

配置文件如下:


#user  nobody;
worker_processes  8;

#error_log  logs/error.log;
#error_log  logs/error.log  notice;
#error_log  logs/error.log  info;

#pid        logs/nginx.pid;

events {
    worker_connections  10240;
}

# load modules compiled as Dynamic Shared Object (DSO)
#
#dso {
#    load ngx_http_fastcgi_module.so;
#    load ngx_http_rewrite_module.so;
#}

http {
    include       mime.types;
    default_type  application/octet-stream;

    #log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
    #                  '$status $body_bytes_sent "$http_referer" '
    #                  '"$http_user_agent" "$http_x_forwarded_for"';

    #access_log  logs/access.log  main;

    sendfile        on;
    #tcp_nopush     on;

    #keepalive_timeout  0;
    keepalive_timeout  75;

    proxy_buffer_size 128k;
    proxy_buffers   32 128k;
    proxy_busy_buffers_size 128k;

    #gzip on;

 server {
    listen 9018;
    server_name 172.16.2.167;
		location / {
			#root /;设定作用的根目录
			root F:/ ;
		}
	}
}
以上配置后,文件服务器配置地址如下:
file_http_url=http://172.16.2.167:9018/
file_save_path=f:/

你可能感兴趣的:(nginx)