Saltar al contenido
56K

56K

Slow IT Notes – Just 4 Fun

Menú
Menú

Archivos y directorios visibles con Nginx

Publicada el 14/11/202106/02/2023 por 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.

Deja una respuesta

Tu dirección de correo electrónico no será publicada. Los campos obligatorios están marcados con *

fanta de naranja
💾 QEMU
💾 SOLARIS
💾 ESXi
💾 FREEBSD
💾 DEBIAN
💾 AMIGA
💾 SYSADMIN
💾 JUNOS
💾 IMPRIMIR
💾 MSDOS
💾 WINDOWS
💾 FAIRPHONE
💾 GAMING
💾 STREAMING
💾 REDHAT
💾 GRÁFICOS
💾 CACHARROS
💾 SONIDO
💾 NETWORKING
💾 ROCKY
💾 SUSE
💾 TMP
©2025 56K | Construido utilizando WordPress y Responsive Blogily tema por Superb