# Using Nextcloud with Cloudflared

**URL:** https://dietpi.com/forum/t/using-nextcloud-with-cloudflared/14061
**Category:** Troubleshooting
**Created:** [23 August 2022 01:52 UTC](https://dietpi.com/forum/t/using-nextcloud-with-cloudflared/14061 "2022-08-23T01:52:11Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![howardroark](https://dietpi.com/forum/letter_avatar_proxy/v4/letter/h/6a8cbe/32.png) [@howardroark](https://dietpi.com/forum/u/howardroark)
#### Post date: [23 August 2022 01:52 UTC](https://dietpi.com/forum/t/using-nextcloud-with-cloudflared/14061/1 "2022-08-23T01:52:11Z")

</div>

Hi,

I am installed Nextcloud over DietPiOS. I am also running some docker containers with Cloudflared tunnel and making them online. It seems Nextcloud uses subfolder connection instead of port (like /nextcloud) I was able to configure port connections with Cloudflared but Nextcloud uses subfolder instead of port url.

I am wondering, how can I open Nextcloud for internet access with a subdomain?

Thanks.

---

<div class="post-metadata">

### Author: ![Jappe](https://dietpi.com/forum/user_avatar/dietpi.com/jappe/32/1788_2.png) [@Jappe](https://dietpi.com/forum/u/Jappe)
#### Post date: [23 August 2022 02:39 UTC](https://dietpi.com/forum/t/using-nextcloud-with-cloudflared/14061/2 "2022-08-23T02:39:12Z")

</div>

I assume you use the defualt webserver lighttpd, then you can check this out:  
[https://redmine.lighttpd.net/projects/1/wiki/docs\_modrewrite#With-mod\_redirect](https://redmine.lighttpd.net/projects/1/wiki/docs_modrewrite#With-mod_redirect)

There was also the same question in the past, it’s worth reading why it’s maybe not so a good idea / make thngs more complicated:  
[https://dietpi.com/forum/t/nextcloud-sub-domain/5219/3?u=jappe](https://dietpi.com/forum/t/nextcloud-sub-domain/5219/3)

---

<div class="post-metadata">

### Author: ![MichaIng](https://dietpi.com/forum/user_avatar/dietpi.com/michaing/32/7_2.png) [@MichaIng](https://dietpi.com/forum/u/MichaIng)
#### Post date: [23 August 2022 05:22 UTC](https://dietpi.com/forum/t/using-nextcloud-with-cloudflared/14061/3 "2022-08-23T05:22:00Z")

</div>

> [@howardroark](#):
>
> Nextcloud uses subfolder connection instead of port

It uses the default HTTP/S ports 80/443 if that helps. AFAIK the subdir itself is not an issue for the Cloudflare tunnel.

---

<div class="post-metadata">

### Author: ![Joulinar](https://dietpi.com/forum/user_avatar/dietpi.com/joulinar/32/57_2.png) [@Joulinar](https://dietpi.com/forum/u/Joulinar)
#### Post date: [23 August 2022 08:55 UTC](https://dietpi.com/forum/t/using-nextcloud-with-cloudflared/14061/4 "2022-08-23T08:55:07Z")

</div>

> [@Jappe](#):
>
> defualt webserver lighttpd

@Jappe in meantime, we changed this behaviour and `lighttpd` is not the default web server anymore. We added a selection screen to ask which web server to install 😉

---

<div class="post-metadata">

### Author: ![MichaIng](https://dietpi.com/forum/user_avatar/dietpi.com/michaing/32/7_2.png) [@MichaIng](https://dietpi.com/forum/u/MichaIng)
#### Post date: [23 August 2022 15:57 UTC](https://dietpi.com/forum/t/using-nextcloud-with-cloudflared/14061/5 "2022-08-23T15:57:48Z")

</div>

And Apache is the default now for non-interactive installs on new images if it hasn’t been changed in `dietpi.txt` 🙂.

---

<div class="post-metadata">

### Author: ![howardroark](https://dietpi.com/forum/letter_avatar_proxy/v4/letter/h/6a8cbe/32.png) [@howardroark](https://dietpi.com/forum/u/howardroark)
#### Post date: [26 August 2022 13:24 UTC](https://dietpi.com/forum/t/using-nextcloud-with-cloudflared/14061/6 "2022-08-26T13:24:04Z")

</div>

Thank you for all your replies.

I am using Nginx as the default web server. In the Cloudflared config.yml file, when i use the path URL like I got an error.

Cloudflared config.yml

```auto
- hostname: nextcloud.sitename.com
  service: http://localhost/nextcloud

```

`cloudflared tunnel run tunnel-name`

Output:

```auto
ERR Couldn't start tunnel error="http://localhost/nextcloud is an invalid address, ingress rules don't support proxying to a different path on the origin service. The path will be the same as the eyeball request's path"
http://localhost/nextcloud is an invalid address, ingress rules don't support proxying to a different path on the origin service. The path will be the same as the eyeball request's path

```

---

<div class="post-metadata">

### Author: ![Joulinar](https://dietpi.com/forum/user_avatar/dietpi.com/joulinar/32/57_2.png) [@Joulinar](https://dietpi.com/forum/u/Joulinar)
#### Post date: [26 August 2022 14:15 UTC](https://dietpi.com/forum/t/using-nextcloud-with-cloudflared/14061/7 "2022-08-26T14:15:32Z")

</div>

Did you tried to set `http://localhost` as service only?

---

<div class="post-metadata">

### Author: ![howardroark](https://dietpi.com/forum/letter_avatar_proxy/v4/letter/h/6a8cbe/32.png) [@howardroark](https://dietpi.com/forum/u/howardroark)
#### Post date: [27 August 2022 15:18 UTC](https://dietpi.com/forum/t/using-nextcloud-with-cloudflared/14061/8 "2022-08-27T15:18:57Z")

</div>

Yes, that doesn’t work either.

Update: Yes, it works but with [subdomain.site.com/nextcloud](http://subdomain.site.com/nextcloud) How can i access Nextcloud directly wtih [subdomain.site.com](http://subdomain.site.com)?

---

<div class="post-metadata">

### Author: ![Joulinar](https://dietpi.com/forum/user_avatar/dietpi.com/joulinar/32/57_2.png) [@Joulinar](https://dietpi.com/forum/u/Joulinar)
#### Post date: [29 August 2022 12:42 UTC](https://dietpi.com/forum/t/using-nextcloud-with-cloudflared/14061/9 "2022-08-29T12:42:04Z")

</div>

This would require rewriting Nginx configuration files to create a VirtHost entry for Nextcloud running in webroot of nginx
