Rewrite only the base URL to a sub-page, using Nginx Proxy Manager
Let’s assume you run Prosody as your XMPP server, and use Converse.js as your web chat client. Using Prosody’s mod_conversejs, your base URL (say
https://chat.example.com:5281/) will show just a boring “Prosody is running” page, and serve the web chat client under
What you want instead is your main page directly show the Converse.js web chat under
https://chat.example.com/ but still be able to access sub-paths and files in your web root directly (like maybe
favicon.ico, or Prosody’s BOSH URL
Let’s further assume you use the Nginx Proxy Manager (NPM) for increased safety and reverse-proxying to your local machine/container/VM called
prosody (resolvable via local LAN DNS).
For your NPM Proxy Host, you’ll need to set up two custom locations—one for setting up some parameters and possibly extra headers, under
location /, and another one to redirect only the base URL (without anything following it, like a path or file name) to your
location = /. Yes, you read correctly: NPM actually allows using the same syntax you’d use in the Nginx web server configuration files!
Here is how that looks like:
prosody as a simple host name—resolved by my local DNS—, you can also use an IP address or a FQDN.)
Now, when visiting
https://chat.example.com/, your visitors will be greeted by the Converse.js login screen! And all the rest (like a personal
favicon.ico or the BOSH URL) will still work.