Skip to content

aladac/nginx-gallery

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

nginx-gallery

A simple photo/video gallery using only an XSLT stylesheet for nginx's autoindex function. Zero server-side code required.

Features

  • Grid layout for images and videos
  • Breadcrumb navigation
  • Lazy loading for images
  • Dark theme
  • Supports mp4, webm, mkv, avi, wmv, flv, ogv video formats

Dependencies

None - all CSS and fonts are included in the project.

Preview

Screenshot 2023-08-07 at 22 45 37 Screenshot 2023-08-07 at 22 46 19 Screenshot 2023-08-07 at 22 47 38

Credit

Installation

  1. Copy nginx-gallery.xslt to your nginx configuration directory (e.g., /etc/nginx/)
  2. Copy css/ and webfonts/ directories to your web root (e.g., /var/www/nginx-gallery/)
  3. Configure your server block as shown below
  4. Reload nginx: sudo nginx -s reload

Sample Configuration

server {
    listen 80;
    listen [::]:80;

    # If using default cert generated with certbot
    #
    # ssl_certificate /etc/letsencrypt/live/your.server.domain/fullchain.pem;
    # ssl_certificate_key /etc/letsencrypt/live/your.server.domain/privkey.pem;
    #
    # listen 443 ssl;
    # listen [::]:443 ssl;

    root /var/www/nginx-gallery;

    server_name your.server.domain;

    location / {
        xslt_string_param title $1;
        autoindex on;
        autoindex_format xml;
        xslt_stylesheet /etc/nginx/nginx-gallery.xslt path='$uri';
    }
}

Requirements

License

MIT

About

Photo/video gallery using XSLT stylesheet for nginx autoindex

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors