Install Nextcloud with reverse Proxy
from fuzzy_feeling@programming.dev to selfhosted@lemmy.world on 03 Apr 2024 09:53
https://programming.dev/post/12314209

hey guys

I’m pretty new to this web-stuff

i got a vps where i’d like to install nextcloud. i want it to be reachable via cloud.example.com

i also have a homeserver with octoprint and stuff on it. i’d love to be able to access that with octoprint.example.com

that’s what you pros use a reverse proxy for, right? but how do i do that?

install nextcloud with appache and use nginx as the proxy? i guess i could also use haproxy for that as well? what would you recomend as setup?

sadly nginx proxy manager is no option. but is there another easy to config method?

#selfhosted

threaded - newest

lemmyreader@lemmy.ml on 03 Apr 2024 09:58 next collapse

From the Nextcloud docs : docs.nextcloud.com/…/reverse_proxy_configuration.…

GravitySpoiled@lemmy.ml on 03 Apr 2024 10:05 next collapse

I’d install it via podman (or docker) compose.

I use nginx proxy manager but traefik or caddy should be recommended I guess

Haystack@lemmy.world on 03 Apr 2024 10:10 next collapse

I use Caddy V2 (running in Docker/Podman). Configuration can be even simpler than the below. It automatically sorts out the SSL certs from Let’s Encrypt for you. If you use Cloudflare DNS challenge like I do, you can get SSL without the server having to be exposed to the internet.

cloud.example.com {
  encode zstd gzip
  tls {
    dns cloudflare {$CLOUDFLARE_API_TOKEN}
    resolvers 1.1.1.1 1.0.0.1
  }
  reverse_proxy nextcloud.my.local.domain:80
}

If you want it exposed then you can just use the default HTTP challenge.

cloud.example.com {
  encode zstd gzip
  reverse_proxy nextcloud.my.local.domain:80
}

And yes you can add any number of sites on subdomains like this and it will reverse proxy them to the correct server based on the domain name.

fuzzy_feeling@programming.dev on 03 Apr 2024 10:37 collapse

that looks promising.

guess i’ll take a look at caddy.

thank you very much.

PieMePlenty@lemmy.world on 03 Apr 2024 11:28 next collapse

I used docker to get nextcloud and nginx conf to reverse proxy to it. It works well and is not difficult to set up by following their guide on github. It works pretty much out of the box.

Decronym@lemmy.decronym.xyz on 03 Apr 2024 11:35 next collapse

Acronyms, initialisms, abbreviations, contractions, and other phrases which expand to something larger, that I’ve seen in this thread:

Fewer Letters More Letters
DNS Domain Name Service/System
HTTP Hypertext Transfer Protocol, the Web
SSL Secure Sockets Layer, for transparent encryption
nginx Popular HTTP server

4 acronyms in this thread; the most compressed thread commented on today has 6 acronyms.

[Thread #652 for this sub, first seen 3rd Apr 2024, 11:35] [FAQ] [Full list] [Contact] [Source code]

atzanteol@sh.itjust.works on 03 Apr 2024 13:10 next collapse

I would keep octopi off the Internet (local network only). There’s too much risk that if somebody did get access they could heat your hot-end up to 300C and just leave it there or something… Setup a vpn if you want remote access to it.

fuzzy_feeling@programming.dev on 03 Apr 2024 15:53 collapse

good point

but octoprint was more of an example. not the best, for sure

hperrin@lemmy.world on 04 Apr 2024 06:24 collapse

I use both nginx and haproxy, and nginx is much easier to configure. That being said, haproxy has more features, like working as a load balancer with traffic shaping/shifting. But it sounds like you don’t need those features.