Nginx开启目录访问功能

Nginx目录访问开启的三种场景

# configuration file /etc/nginx/conf.d/server81.conf:
server {
      listen       81;
      server_name  localhost;
      location / {
          root /;
          autoindex on;
          autoindex_localtime on;
       }
 }

# configuration file /etc/nginx/conf.d/server82.conf:
server {
      listen       82;
      server_name  localhost;
      location /download {
          root /usr/share/nginx/;
          autoindex_exact_size off;
          autoindex on;
          autoindex_localtime on;
       }
 }

# configuration file /etc/nginx/conf.d/server83.conf:
server {
      listen       83;
      server_name  localhost;
      location /download {
          alias /home/nginx/;
          autoindex_exact_size off;
          autoindex on;
          autoindex_localtime on;
       }
 }

你可能感兴趣的:(nginx,java,服务器)