60 likes | 82 Views
Sometimes you may need to change NGINX autoindex output format. Here are the steps to do it.#nginx #webdevelopment <br><br>Visit https://fedingo.com/how-to-change-nginx-autoindex/
E N D
How to Change NGINX AutoIndex Starting NGINX 1.7.9 this feature is available out of the box, using autoindex_format directive. Just add these two lines in your server configuration’s http block to enable XML format for file/directory listing. autoindex on; autoindex_format xml;
How to Install Fancy Index NGINX Module This module needs to be compiled with source, during NGINX installation and cannot be added afterwards. Let us say you have downloaded NGINX tarball as per your requirement. Run the following command to unzip it. $ gunzip -c nginx-?.?.?.tar.gz | tar -xvf - Next, download latest version of fancy index from its git repository. $ git clone https://github.com/aperezdc/ngx-fancyindex.git ngx-fancyindex
Install Fancy Index NGINX Module Then run the following command to change to the unzipped folder which contains NGINX source files, run configuration script with required options and use –add-module option to install additional modules. $ cd nginx-?.?.? $ ./configure --add-module=../ngx-fancyindex [extra desired options] Build and Install Software. $ make $ sudo make install
Enable Fancy Index Directive Once you have installed NGINX with fancy index module, you can enable it by adding the fancy_index directive in location block. location / { fancyindex on; # Enable fancy indexes. fancyindex_exact_size off; # Output human-readable file sizes. }
Thank You Visit for details https://fedingo.com/how-to-change-nginx-autoindex/