Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ftntming/eb85574fdd80b4ff48ab7b3297fb0d58 to your computer and use it in GitHub Desktop.
Save ftntming/eb85574fdd80b4ff48ab7b3297fb0d58 to your computer and use it in GitHub Desktop.
Ejabberd (19.08+) mod_http_upload and Nginx reverse-proxy

If we have xmpp server on host domain.tld and want serve files from https://xmpp.domain.tld/upload/…

/etc/ejabberd/ejabberd.yml


listen
  port: 5280
  ip: "127.0.0.1"
  module: ejabberd_http
    request_handlers:
      "/upload": mod_http_upload

  mod_http_upload:
    host: "xmpp.@HOST@"
    docroot: "/srv/ejabberd/uploads"
    put_url: "https://xmpp.@HOST@/upload"
 

/etc/nginx/sites-enabled/xmpp.domain.tld

location / {
    proxy_set_header Host $host;
    proxy_pass http://127.0.0.1:5280;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment