---
title: "使用nginx搭建文件下载服务器"
author: "junmail"
date: "2015-11-20T10:55:29Z"
tags: []
categories: ["操作系统"]
slug: "nginx"
draft: false
lastmod: "2015-11-20T10:55:29Z"
id: 2258055
url: "https://dbajun.iteye.com/blog/2258055"
---

nginx.conf配置如下：

 

user  root;

worker\_processes  8;

 

events {

    worker\_connections  1024;

}

 

http {

    include       mime.types;

    default\_type  application/octet-stream;

    sendfile        on;

    tcp\_nopush      on;

    keepalive\_timeout  65;

 

        server {

        listen       8009;

        server\_name  localhost;

        autoindex on;

        autoindex\_exact\_size off;

        autoindex\_localtime on;

        location / {

            root   /usr/local/nginx/fileserver;

            index  index.html index.htm;

        }

 

        error\_page   500 502 503 504  /50x.html;

        location = /50x.html {

            root   html;

        }

    }

}