美文网首页
nginx搭建文件服务器

nginx搭建文件服务器

作者: 王的星球 | 来源:发表于2018-02-07 16:35 被阅读0次

    server {

        listen      8888 default_server;

        server_name  _;

        root        /usr/local/webserver/; #/usr/share/nginx/html;

        # Load configuration files for the default server block.

        include /etc/nginx/default.d/*.conf;

        location ~ /$ {

              autoindex on;

              autoindex_localtime on; #之类的参数写这里

              autoindex_exact_size off;

        }

        location ~ /.+\.xml$ {

            #add_header Content-Type "text/html;charset utf-8;";

            #default_type text/xml;

        }

        location ~ /.+ {

              add_header Content-Type "text/plain;charset utf-8;";

        }

        error_page 404 /404.html;

            location = /40x.html {

        }

        error_page 500 502 503 504 /50x.html;

            location = /50x.html {

        }

    }

    相关文章

      网友评论

          本文标题:nginx搭建文件服务器

          本文链接:https://www.haomeiwen.com/subject/wzkazxtx.html