Install web app on main domain while keeping Synapse it's server name

Hi. I want to share with you how to install some web application on your domain, while keeping Synapse having it’s server name for it.
This is to mitigate a bug in current packaging solution, where Synapse is trying to set delegation, but needs to reserve whole domain to itself instead of just .well-known directory.
In this post I would use example.com and my_webapp as an example, but you can change it to your needs (should work with Nextcloud).

  • set you default Yunohost domain as something like yuno.example.com
  • keep example.com root (/) clean from apps
  • install your web app on any subdomain, like www.example.com (or cloud.example.com if it’s Nextcloud, etc.)
  • install Synapse on matrix.example.com with server name set as example.com, as always
  • make symlink (change this command to your needs): ln -s /etc/nginx/conf.d/www.example.com.d/my_webapp.conf /etc/nginx/conf.d/example.com.d/

Now we also need to disable SSO logins from popping up on web app. This is also why we need to set default Yunohost domain to subdomain too, like yuno.example.com, to make SSO login still working on other apps.

  • in /etc/nginx/conf.d/example.com.config comment all lines starting with access_by_lua_file

  • Restart Nginx: systemctl restart nginx

Hope this helps someone, as it is quite clean solution with just one symlinked file and commented out one argument.