Setting up different subdomains for different apps

Hi.

I’d like to set up subdomains for my apps, but can’t seem to wrap my head around how to do it.

In other words, I’d like
https://nextcloud.example.com/index.php/apps/calendar/
to become
https://calendar.example.com

I’m running Nginx, and I think this is doable with proxy_pass and rewrite, but yeah… I have no idea on how regexp works and I’m very unsure on how rewrite works at all.

Does anyone have any idea on how to do this? I’d be forever grateful.

EDIT: formatting.

1 Like

Take a loot at reverse proxy.

Here is a good tutorial: https://www.digitalocean.com/community/tutorials/how-to-configure-nginx-as-a-web-server-and-reverse-proxy-for-apache-on-one-ubuntu-16-04-server#step-6-—-installing-and-configuring-nginx

Regards

Sorry, I should have been more clear. I already know the basics of reverse proxying and SSL certs. For some reason a simple proxy_pass doesn’t work, so there’s some need for rewrite, I think.

@loidor what do you mean with rewrite? Rewriting the url or what do you mean :slight_smile:

Aye :slight_smile:

https://nginx.org/en/docs/http/ngx_http_rewrite_module.html#rewrite

Problem is, I have no idea about how regexp works, so I though I should ask here if someone had done it before.

Until I find a better way, I’ve just setup a return to the ordinary page.

return 301 https://nextcloud.example.com/index.php/apps/contacts/;