A simple photo/video gallery using only an XSLT stylesheet for nginx's autoindex function. Zero server-side code required.
- Grid layout for images and videos
- Breadcrumb navigation
- Lazy loading for images
- Dark theme
- Supports mp4, webm, mkv, avi, wmv, flv, ogv video formats
None - all CSS and fonts are included in the project.
- Breadcrumbs taken from this GitHub project
- Gallery taken from this stack post
- Copy
nginx-gallery.xsltto your nginx configuration directory (e.g.,/etc/nginx/) - Copy
css/andwebfonts/directories to your web root (e.g.,/var/www/nginx-gallery/) - Configure your server block as shown below
- Reload nginx:
sudo nginx -s reload
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';
}
}- nginx compiled with the ngx_http_xslt_module
MIT