-
Notifications
You must be signed in to change notification settings - Fork 44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Publish website under another domain #83
Comments
This isn't possible at the moment. However, I'll mark this issue as enhancement, so we might implement it in a future version of Pico CMS for Nextcloud. As an alternative you could install a separate instance of Pico (http://picocms.org/) and mount Pico's |
Can we not use Apache redirection or something along those lines to have it done invisibly? I'm intending on hosting on the same domain, but that instead of the site being at /sites/sitename, I would want it to be at the root of the domain. |
You might use |
It would be awesome if we will be able to do that through NextCloud in the future. |
This is my workaround for the issue, but requires additional DNS setup, an extra php script outside of Nextcloud/Pico, and a couple config options added to my Apache config. Eventually, if some of this functionality were built in to Nextcloud/Pico, that would be lovely but for now this is my ball of duct tape and superglue: I have my server set up such that all the Pico sites are accessible via the usual https://my.cloud.server/sites/sitename URL but also have a wildcard dns record pointing to the cloud server and a matching wildcard SSL certificate - this reduces the administrative overhead if more sites get created, but having specific DNS records and matching SAN entries on the SSL certificate works just fine too. EDIT: Since I first wrote this, an update seems to have changed the trusted domain thing so I now have to include any domains that I want to serve sites with in Nextcloud's trusted_domains configuration option. *.my.domain works to and subdomains of my.domain, but my.domain must be included separately if you intend to serve sites from there. In my apache config, I have:
The regex doesn't match URIs that are part of a site, the redirect script (elsewise we'd just end up in a redirect loop), and a few URIs that Pico/Nextcloud needs to pass through to function properly. I haven't the slightest idea what an equivalent nginx configuration would look like.. My redirect php file checks for any GET values that might give it a clue about where to send it based on old links to some of my long-dead sites, and then checks if there is a specific site for a specific http_host:
This, of course, requires me to manually edit the script if my mappings need to change. For anything that doesn't have a specific mapping, it treats the hostname as the site name:
With this, if someone attempts to browse to https://mysite.cloud.server/ it gets redirected to the redirect script which then sends it to https://mysite.cloud.server/sites/mysite/. If a site doesn't exist, it'll show the usual "site not found" page in. With a bit of additional scripting, I imagine I could have it look up in the Nextcloud DB if a site by that name exists first and if not, redirect to my landing page, but that's a tweak for another day. Limitations: In the end, everything still ends up being served up with the /sites/sitename path on it, but at least the domain name is customized. |
I built on @PhrozenByte's suggestion to use All that's needed is this bit of nginx configuration (after setting up the short urls on nextcloud as well):
This way nginx knows which site to proxy to based on the subdomain directly, no further vhosts required. |
Hi
Obviously, you'll need to have a dns record for this blog domain with the same IP as the one of the nexcloud domain. I tried to do the same with Locations but didn't succeed. Edit: you'll access your blog site name myblog through https://blog.mydomain.tld/myblog |
@julianwachholz If this gets solved, then picoCMS could become "next big thing" Nextcloud can - namely "web hosting" 😉. |
@dumblob you are correct. but nothing is stopping you from adding the bare domain there as well. :) |
True 😉. I'm now starting to lean towards the solution from @brasofilo (#57 (comment) ). Thanks for pioneering! |
thanks @leolivier , your solution fixed all my issues. with those ProxyPasses I was even able to use a separate domain / virtualhost ( sepdom.conf -> sepdom.tld ) . @ all: if you dont't wanna access you nextcloud via sepdom.tld then you might use the following RewriteRules for your *:443 virtualhost (I tested them, they should work):
(and leave @leolivier 's SSLProxyEngine part as is.) |
BTW: this feature will soon be available in the NcVM: |
wow, that's fantastic news! 🍻 |
@szaimen thanks! I've skimmed it and it looks pretty complicated - any plans to support "update" by simply re-running the installation scripts any time like in cloudinabox? |
I am not excactly sure what you mean. It is only meant to run in the NcVM. |
@PhrozenByte what are your thoughts on what @szaimen posted above:
Could support for this "domain renaming" be made (at least partially) part of cms_pico rather then relying on some kungfu in one of the many NC installation automation frameworks/scripts? |
My thoughts: Great work! 🚀 ❤️ Hosting websites on different domains is going to be part of Pico CMS for Nextcloud v1.1 (see #99) as its major feature. However, implementing this isn't as easy as one might think, because with an proxy you can easily ensure that one can only request website resources (by simply just proxying a sub-directory), but for a built-in solution this is a huge security-sensitive task. |
@PhrozenByte You are right, and that's why (not sure i did right) i have opened this issue at nextcloud server |
I am new to PicoCMS and Nextcloud but I think this platform is a fantastic idea. ChatGPT has been pivotal in my PHP / programming journey. Where I got to so far with this, until I have seen this thread is setting up a vhosts file, which as I understand it would require further server access than what I currently have on my hosting plan. I had tried a number of htaccess configurations on both the nextcloud installation and the unique domain used for displaying the PicoCMS website. After all the attempts and speaking with both ChatGPT and my hosting providers AI and live customer support, it seems the conclusion is that VPS level hosting is required and the following vhosts file is needed. Is anyone able to confirm the following is still required or what level of access to the server is needed for a better / easier solution instead? <VirtualHost *:80>
<VirtualHost *:443>
|
So, just a quick update to this post, that I have posted also in the other thread server/issues/27473 because it also mentions this discussion and so I posted the following comment: Hi all, Also, I forgot to say that there is also a redirect required through the update of the htaccess setup in Nextcloud also. The below is the HTACCESS update to the existing HTACCESS already available in the /nextcloud/ folder. Obviously if this solution works I am likely to take this route, but if not I might go for a headless CMS solution instead, and there are few I am testing out.
|
Is it possible to make the pico page accessible under another domain?
I want to edit the content within Nextcloud (e.g. nextcloud.mydomain.org) but the site shall be accessible under another domain (e.g. www.mydomain.org).
The text was updated successfully, but these errors were encountered: