nginx 使用教程

nginx 使用教程

nginx 開啓目錄列表使用

autoindex on;
autoindex_exact_size off;
charset utf-8,gbk;

參考 ('http://stephen830.iteye.com/blog/2154049')html

fancyindex擴展 美化

  1. 下載 nginxnginx

  2. 安裝 nginx,添加擴展
    查看原配置 nginx -V, 在原配置基礎上添加 ngx-fancyindex 模塊
    安裝nginx所需環境
sudo apt-get install libxml2 libxml2-dev libxslt-dev
sudo apt-get install libgd2-xpm libgd2-xpm-dev
查看 nginx 當前配置
nginx -V
在當前配置基礎上添加 ngx-fancyindex 模塊
./configure  --add-module=../ngx-fancyindex
編譯
make
報錯
nginx cannot find -lperl

安裝 perllib
apt-get install libperl-dev
將編譯的 nginx 覆蓋原 nginx
sudo mv /usr/sbin/nginx /usr/sbin/nginx-1.1.19
sudo cp objs/nginx /usr/sbin/nginx
最後查看 nginx 模塊是否安裝成功
```
nginx -V
```
  1. 配置 nginx
    打開 /etc/nginx/nginx.conf,添加以下配置
fancyindex on;
    fancyindex_exact_size off;
    fancyindex_localtime on;
    fancyindex_default_sort "date_desc";
    fancyindex_header "/fancyindex/header.html";
    fancyindex_footer "/fancyindex/footer.html";
    fancyindex_ignore "fancyindex";
    #autoindex on;
    #autoindex_exact_size off;
    charset utf-8,gbk;

參考文檔

  1. http://stephen830.iteye.com/blog/2154049
  2. http://blog.csdn.net/llnara/article/details/9613089
  3. http://www.swiftyper.com/2016/12/08/nginx-autoindex-configuration/
  4. http://www.tennfy.com/2489.html
  5. https://github.com/aperezdc/ngx-fancyindex
  6. https://github.com/TheInsomniac/Nginx-Fancyindex-Theme
  7. http://www.cnblogs.com/terrysun/archive/2012/11/22/2782472.html 如何升級Nginx到最新穩定版
  8. http://jingpin.jikexueyuan.com/article/48920.html apt-get 方式安裝nginx後,增長模塊--with-http_perl_module
  9. http://www.cnblogs.com/gaohj/p/7019712.html 實戰開發一個Nginx擴展 (Nginx Module)
  10. http://www.cnblogs.com/lixigang/articles/5130052.html 已安裝nginx動態添加模塊
  11. http://blog.csdn.net/shuzui1985/article/details/7628110 ubuntu 編譯 /usr/bin/ld: cannot find 問題解決
相關文章
相關標籤/搜索