├── .autoindex ├── footer.html ├── header.html └── readme.md ├── LICENSE ├── README.md ├── autoindex_after.png └── autoindex_before.png /.autoindex/footer.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 106 | 235 | 236 | -------------------------------------------------------------------------------- /.autoindex/header.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 | 5 | 6 | 7 | 8 | 9 | 10 | 21 | 22 | -------------------------------------------------------------------------------- /.autoindex/readme.md: -------------------------------------------------------------------------------- 1 | # autoindex 2 | 3 | autoindex for Nginx 4 | 美化 Nginx 默认的目录文件 索引页 5 | 6 | ------ 7 | 8 | ### 配置方法: 9 | 10 | 1. 复制 .autoindex 目录至 D:\websites\fulicat\ 11 | ps: D:\websites\fulicat\\.autoindex 12 | 13 | 14 | 2. 修改 nginx.conf 文件 15 | 16 | ``` 17 | # fulicat.bz 18 | server { 19 | listen 80; 20 | server_name fulicat.bz; 21 | root D:\websites\fulicat; 22 | 23 | location / { 24 | index index.html index.htm index.php; 25 | } 26 | 27 | # autoindex for nginx 28 | location ~ ^(.*)/$ { 29 | autoindex on; 30 | autoindex_localtime on; 31 | autoindex_exact_size off; 32 | 33 | #add_before_body /.autoindex/header.html; 34 | add_after_body /.autoindex/footer.html; 35 | } 36 | 37 | location ~ \.php$ { 38 | fastcgi_pass 127.0.0.1:9000; 39 | fastcgi_index index.php; 40 | fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; 41 | include fastcgi_params; 42 | } 43 | } 44 | ``` 45 | 46 | ------ 47 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2017 Jack Chan 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # autoindex 2 | autoindex for Nginx 3 | 美化 Nginx 默认的目录文件 索引页 4 | 5 | ------ 6 | 7 | ### 配置方法: 8 | 9 | 1. 复制 .autoindex 目录至 D:\websites\fulicat\ 10 | ps: D:\websites\fulicat\\.autoindex 11 | 12 | 13 | 2. 修改 nginx.conf 文件 14 | 15 | ``` 16 | # fulicat.bz 17 | server { 18 | listen 80; 19 | server_name fulicat.bz; 20 | root D:\websites\fulicat; 21 | 22 | location / { 23 | index index.html index.htm index.php; 24 | } 25 | 26 | # autoindex for nginx 27 | location ~ ^(.*)/$ { 28 | autoindex on; 29 | autoindex_localtime on; 30 | autoindex_exact_size off; 31 | 32 | #add_before_body /.autoindex/header.html; 33 | add_after_body /.autoindex/footer.html; 34 | } 35 | 36 | location ~ \.php$ { 37 | fastcgi_pass 127.0.0.1:9000; 38 | fastcgi_index index.php; 39 | fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; 40 | include fastcgi_params; 41 | } 42 | } 43 | ``` 44 | 45 | ------ 46 | 47 | 48 | # Screenshots: 49 | 50 | ### before: 51 |  52 | 53 | ### after: 54 |  55 | -------------------------------------------------------------------------------- /autoindex_after.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fulicat/autoindex/c20d8a9bda4242462b7bfe45d3214ee2221f6e86/autoindex_after.png -------------------------------------------------------------------------------- /autoindex_before.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fulicat/autoindex/c20d8a9bda4242462b7bfe45d3214ee2221f6e86/autoindex_before.png --------------------------------------------------------------------------------