server {

...

  location /emoji {
    autoindex on;
    autoindex_format xml;
    xslt_string_param title $uri;
    xslt_stylesheet /path/to/pleroma/static/emoji-gallery.xslt;
    try_files $uri $uri/ =404;
  }

  location = /emoji/all {
    return 301 /emoji/all/;
  }

  location /emoji/all {
    rewrite ^/emoji/all/?(.*) /$1 break;
    root /path/to/pleroma/static/emoji_all;
    autoindex on;
    autoindex_format xml;
    xslt_string_param title $uri;
    xslt_stylesheet /path/to/pleroma/static/emoji-gallery.xslt;
    try_files $uri $uri/ =404;
  }
}
