Skip to content
56K

56K

Slow IT just 4 fun

Menu
Menu

Archivos y directorios visibles con Nginx

Posted on 14/11/202106/02/2023 by fanta

Con Apache y Nginx es posible y puede interesarnos mostrar la estructura de directorios de forma vistosa. Esto permite al navegante poder ir pasando de un directorio a otro y ver un listado de los archivos que allí se comparten.

Por ejemplo si tenemos 1070 juegos en tar.gz podemos compartirlos de forma sencilla con Nginx.

 

En el servidor Debian se realizarían los siguientes pasos:

# apt install git nginx libnginx-mod-http-fancyindex -y
# rm -rf /var/www/html/index.nginx-debian.html
# git clone https://github.com/neilmenon/Nginxy /var/www/html/Nginxy

 

El archivo /etc/nginx/sites-enabled/default se cambia por este contenido:

server {
    listen 80 default_server;

    root /var/www/html;
    index index.html index.htm index.nginx-debian.html;

    server_name _;

    location / {
        fancyindex on;
        fancyindex_exact_size off;
        fancyindex_localtime on;
        fancyindex_name_length 255;
        fancyindex_footer /Nginxy/footer.html;
        fancyindex_header /Nginxy/header.html;
        fancyindex_css_href /Nginxy/style.css;
        fancyindex_time_format "%B %e, %Y";
        fancyindex_ignore "Nginxy";
    }

    location /Nginxy {
        autoindex off;
    }
}

 

Finalmente pegamos un meneo a nginx así:

# nginx -t && systemctl restart nginx

 

Y disfrutamos de unos directorios más vistosos.

 

Eso es todo.

Saludos cordiales.

Generic selectors
Exact matches only
Search in title
Search in content
Post Type Selectors
🍅 STREAMING
🍊 LINUX
🥝 GAMES
🥥 THREADS
🧅 SECURITY
🥑 RETRO
🍆 HARDWARE
🍇 MISC
©2023 56K | Built using WordPress and Responsive Blogily theme by Superb