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

2019-03-29  本文已影响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

上一篇下一篇

猜你喜欢

热点阅读