Website running parallel to Nextcloud on same domain?

Hello,

I use NextCloud 20.0.7 on Ubuntu server, snap-installation. Via mydomain.org I have extern access to the cloud, everything works fine. I use a Fritzbox and noip.com
Is there an easy possibility to use the domain parallel as Website? For example maydomain.org/website?

Better use a subdomain like otherwebsite.example.com
Using a subdirectory is tricky with getting the .htaccess or Nginx stuff right.

1 Like

Hello and thank you. As far as I see, wildcards must be enabled in noip.com. Right?

You can use overwritewebroot to run Nextcloud in a subfolder of the site.

1 Like

Wildcard certs from Letsencrypt are also a bit tricky to get, just ask for both the main and the subdomain cert when running the request.

1 Like

Did I understand correct? With overwritewebroot’ => ‘/nextcloud’ in config.php the link to my NC is „mydomainpointorg/nextcloud“? And then I can create something like „mydomainpointorg/webpage“ for my webpage?

That’s my understanding. I don’t do it that way personally. I use separate subdomains.

1 Like

I would recommand you to go the “multi name” way and configure separate virtual hosts in your webserver for each service you run. It’s easier to manage and more secure.

I don’t know noip.com. But to get wildcard certs you have to own the actual domain name, not just the subdomain part of it. Normaly you get something like “yourservername.noip.com” with dyndns providers like noip, of wich you only own the “yourservername” part.

There are to relative easy ways how you can get multiple subdomains with one dynamic IP address:

  1. You register a second noip name that points to the same IP-address. If they don’t let you use multiple names with the free plan, you could maybe register a second account with them or use another dyndns provider like afraid.org for the second name.

  2. You buy an actual domain name, then you could cname as many subdomins of your registred domain name to a single dyndns name as you want. That’s what i’m doing.

1 Like

Thanx, it is possible to register a second domain for the same IP, I just tried. But before going further on in a way, which is maybe the wrong one: Has the second domain access to my nextcloud? All about is solving this problem: How to Grant Access from extern Website to Nextcloud? - #2 by Hasso

Has the second domain access to my nextcloud?

That depens on how you configure the webserver and the config.php. In apache you could add a ServerAlias directive with the second name and in the config.php you have to add it as trusted domain. then it would work. But I doubt that it solves the CORS policy problem you’re facing in the other thread because your gameserver is still a diffrent origin with a diffrent domain name. But beeing honest, I’m not sure that I completely understand what you try to achieve there…

2 Likes

Well, it should habe been a workarround. I thought of putting the game on „mydomainpointorg/website“ so it can access to „mydomainpointorg/nextcloud“. I thought, due to the same domains, the CORS policy problem would not be.

I’m no expert on this topic. But as I understand it, Cross-Origin Resource Sharing (CORS) are additional HTTP-Headers that allow a web server to indicate any other domains or ports than it’s own and than inform the browser that it has either granted or denied this web application access to selected resources.

These header settings are preconfigured in the .htaccess file inside the nextcloud folder and are controlled by the web server. The .htaccess file can of course be adjusted or you can deactivate the use of .htaccess completely. But then you have to put all the necessary settings that nextcloud needs to run, and more important needs to run securley, to your virtualhost config file. Don’t do that, unless you know exactly what you’re doing. :wink:

1 Like

As you have probably noticed from my questions, I am a total beginner. I think the risk of something going wrong is too great…

probably… :wink:

Just kidding, I’am no professional either and it took me a rather long time until I felt confident enough to expose my nextcloud to the internet and put my private files on it and everything. And I’m still pretty cautios, when I do not fully understand things. And this thing of yours has way to many unknowns, that I could give you an advice what to do. My only suggestion would be that you maybe should read up a bit about how networks, webservers etc work in general and then thinker with things on a local test server or on a VPS without any private data on it. And for the short term i’am sure there is some other and possibly even easier way to provide this file to your game server.

1 Like

Yes, probably it is easier to change the game :smile:

I installed NC on my hosted web server. For example, if web files are in /http, I created a directory, e.g. /http/nc and installed it there using the web installer. I get to the instance via the path https://http/nc. Only problem I had was getting the hosting service to give me full access to my database.

Far easier from configuration aspect and also to prevent a lot of potential problems with path rewrites to use subdomains vs subdirectories…

https://nc.domain.com usually preferred to https://domain.com/nc

That’s my two cents. No ip-com allows for subdomains. Either of the two examples above can work, I think however you’ll find just easier configuration with subdomains rather than subdirectories.