美文网首页
nginx索引指定目录的简单配置

nginx索引指定目录的简单配置

作者: 多余的午宴 | 来源:发表于2019-03-29 10:27 被阅读0次

    配置文件

    worker_processes  4;
    error_log  logs/error.log  warn;
    pid        logs/nginx.pid;
    events {
        use epoll;
        worker_connections  1024;
    }
    http {
        include       mime.types;
        default_type  application/octet-stream;
    
        keepalive_timeout  30;
    
        gzip  on;
        gzip_types  text/javascript text/plain text/css application/xml application/x-javascript;
    
        server {
            listen       80;
            server_name  localhost;
            charset utf-8;
                    location / {
                       root /www/;
                       autoindex on;
                       autoindex_exact_size off;
                       autoindex_localtime on;
                       autoindex_format html;
                    }
            }
    
        }
    

    reference

    https://blog.csdn.net/zht666/article/details/16888559
    https://blog.csdn.net/lihuapiao/article/details/53560912

    相关文章

      网友评论

          本文标题:nginx索引指定目录的简单配置

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