1

I'm trying to setup several webapps (nextcloud, roundcube) on one domain, let's say example.com, without using cname subdomains. I installed webapps in default location /usr/share/webapps/ and I want this directory to be also my webroot server. How can I achieve effect like this:

example.com -> /usr/share/webapps/index.html
example.com/nextcloud -> /usr/share/webapps/nextcloud/
example.com/roundcube -> /usr/share/webapps/roundcube/

Using (if possible) several nginx configurations file? For example, nginx config for nextcloud contains few server blocks while roundcube config from archwiki (server is running Arch Linux) is all written in one location block. How should look nginx configuration to make all this working and with option to easily add new webapps?

  • Use subdomains. It is much, much easier, and prevents the web apps from interfering with each other. – Michael Hampton Jul 03 '20 at 18:50
  • How then configure roundcube? – randomnick4671 Jul 03 '20 at 18:53
  • How do you rate your nginx configuration knowledge? What do you understand and what you don't from that configuration examples? What you're asking for can be done, it is even not as difficult as it seems, but if you want to be able to extend your configuration in future, you should understand what you are doing. – Ivan Shatsky Jul 04 '20 at 07:48
  • It's my first time when I use nginx. In general I understand what both of these configs do, but I'm not sure how to change nextcloud like configuration to roundcube like. I tried rewriting roundcube config to another server block (with own subdomain as sugessted by @MichaelHampton) by just removing prefixes `/webmail`, adding `listen` and changing `alias` to `root`, but it can't load image from `skin` subdirectory when testing it in browser, so I don't know if everything is working properly. Is this proper config and can I use it to modify nextcloud config? – randomnick4671 Jul 04 '20 at 09:35
  • I also realized that I need postfix admin and I don't want to create another cname subdomain just for it – randomnick4671 Jul 04 '20 at 09:38
  • You should start your comments with someone name like `@IvanShatsky` (unless you write a comment for some user under his question or answer) if you want them to be read by that user quickly, because otherwise they won't passed to that user inbox. I read your comments by accident. I'll try to explain you some basics, but maybe not today. BTW I wonder how roundcube could work with that config at all. – Ivan Shatsky Jul 06 '20 at 05:57

0 Answers0