On the reverse proxy warning, see:
![]()
"The reverse proxy header configuration is incorrect, or you are accessing Nextcloud from a trusted proxy"
▶ Support intro Nextcloud version (eg, 20.0.5): 24.0.1 and 23.0.4 Operating system and version (eg, Ubuntu 20.04): FreeBSD 13.1, in a jail under TrueNAS CORE 13.0 Apache or nginx version (eg, Apache 2.4.25): Caddy 2.5.1 PHP version (eg, 7.4): 8.0.18 The issue you are facing: After...help.nextcloud.com
What about either of these do you think is a mess? Both Heimdall and Nextcloud, as I install them with my scripts, use Caddy as the web server--just as other guides/scripts/plugins use Apache or nginx as web servers. If you also want to use Caddy as a reverse proxy to allow remote access to internal resources, you have a few options:But how do I clean up the Caddy mess that already included when previously installed nextcloud and heimdall.
{ email admin@mydomain } ombi.mydomain { reverse_proxy 192.168.1.28:5000 } bitwarden.mydomain { reverse_proxy https://bitwarden.mydomain } opnsense.mydomain { @denied not remote_ip 192.168.0.0/22 abort @denied reverse_proxy localhost:81 }
Sorry, I don't meant to say they were a mess. They're perfectly neat and working nice haha. I'm just a bit OCD when it come to stuff just sitting there without getting use and I like to keep thing clean. Now, I don't know if the Caddy instances in nextcloud and heimdall would get use anymore if I created a new instances of Caddy in a separate jail.What about either of these do you think is a mess?
{
# debug
##acme_ca https://acme-staging-v02.api.letsencrypt.org/directory
email example@gmail.com
# default_sni example.com
}
example.us {
root * /usr/local/www/nextcloud
file_server
log {
output file /var/log/example.com.log
format single_field common_log
}
php_fastcgi 127.0.0.1:9000 {
env front_controller_active true
}
header {
# enable HSTS
Strict-Transport-Security max-age=31536000;
}
# client support (e.g. os x calendar / contacts)
redir /.well-known/carddav /remote.php/dav 301
redir /.well-known/caldav /remote.php/dav 301
redir /.well-known/webfinger /index.php/.well-known/webfinger 301
redir /.well-known/nodeinfo /index.php/.well-known/nodeinfo 301
# .htaccess / data / config / ... shouldn't be accessible from outside
@forbidden {
path /.htaccess
path /data/*
path /config/*
path /db_structure
path /.xml
path /README
path /3rdparty/*
path /lib/*
path /templates/*
path /occ
path /console.php
}
respond @forbidden 404
}
:80 {
encode gzip
log {
output file /var/log/heimdall_access.log
}
root * /usr/local/www/html/public
file_server
php_fastcgi 127.0.0.1:9000
# Add reverse proxy directives here if desired
}
Sorry to be blunt, but I think you're going to need to do some reading so that it isn't so far over your head. You're looking to expose portions of your home network to the Internet. The Internet is a dangerous place, and you have private data on your home network that you don't want to expose. Doing this safely takes some planning.but it is a little bit over my head.
No, that wouldn't work--that Caddy jail wouldn't have access to the data for either Nextcloud or Heimdall. The Caddyfile in that jail would consist only of reverse proxy statements, like this:So, what I am planning on doing would just be the 2nd option as you suggested. If I do that, then do I need to copy all the stuff in the Caddyfile within Nextcloud and Heimdall to the newly created Caddyfile in the new jail?
cloud.yourdomain { reverse_proxy 192.168.100.100 } heimdall.yourdomain { reverse_proxy 192.168.100.101 } radarr.yourdomain { reverse_proxy 192.168.100.102:7878 }
Yes, they would. Again, Caddy is acting as a web server in both of those cases. Like Apache and nginx, Caddy is a web server that can also act as a reverse proxy--it's just considerably easier to configure, for either application (or both together).Now, I don't know if the Caddy instances in nextcloud and heimdall would get use anymore if I created a new instances of Caddy in a separate jail.
I don't have an OPNsense router so I am not familiar with that configuration.That's why I suggested doing the proxying in the Nextcloud jail. To do that, you'd just add the proxy statements (as above) to the Caddyfile there.
I already have forward port 80 and 443 to my nextcloud and I can access it from outside of my home network for a while. Seem like my only option is to edit the Caddyfile located within nextcloud. Now, my questions are:If you also want to use Caddy as a reverse proxy to allow remote access to internal resources, you have a few options:
- Edit the Caddyfile in one of the existing installations to do this, and use your router to forward ports 80 and 443 to that jail
- Create a separate Caddy jail, edit its Caddyfile to act as a reverse proxy, and forward 80 and 443 there
- If you're using OPNsense for your router, install Caddy there and configure that Caddyfile accordingly
- ...or use the better-supported HAProxy, but then you aren't using Caddy--and I find it's a lot easier to write three lines of Caddyfile than click through 27 different steps of HAProxy configuration
Sure.Can I add reverse proxy for things that I want to expose to the internet in the Caddyfile within nextcloud. AND also add reverse proxy for thing that I want to keep within my LAN in the Caddyfile within Heimdall?
A CNAME would probably be the most appropriate, though it's with your DNS provider--who may, but need not, be the same as your domain registrar.If the answer to the above question is yes. Then do I need to create an A record or anything like that from my domain registrar?
It will only be accessible from within your LAN.What will happen to the stuff that I added to the Caddyfile within heimdall since I only forward port 80 and 443 to my nextcloud?
How would my Caddyfile in both instances look like? I don't want to just randomly taking thing out or add in things that I am not suppose to. I have the Caddyfile inlcluded above.Sure.
So this will work even I only have forward port 80 and 443 to the nextcloud Caddyfile? I am just wondering how my DNS provider would communicate with the Caddyfile within heimdall?It will only be accessible from within your LAN.
No, you shouldn't randomly be making changes to your server configuration for something that's exposed to the Internet, and really, you should be doing some homework of your own to understand how to do this in the Caddyfile. I think I've given enough examples up-topic to get you started; beyond that, you may be better off asking at the Caddy community if the Caddy docs aren't clear enough.I don't want to just randomly taking thing out or add in things that I am not suppose to.
You've forwarded ports 80 and 443 to the Nextcloud jail. The Caddyfile is the configuration file for the Caddy web server inside that jail.So this will work even I only have forward port 80 and 443 to the nextcloud Caddyfile?
I have no idea what you're asking here--why, and in what way, do you think your DNS provider would need to communicate with the Heimdall jail?I am just wondering how my DNS provider would communicate with the Caddyfile within heimdall?
I have nextcloud jail and heimdall in 2 different jail. So if I only forwarded port 80 and 443 to the nextcloud jail. How is the heimdall Caddyfile work?You've forwarded ports 80 and 443 to the Nextcloud jail. The Caddyfile is the configuration file for the Caddy web server inside that jail.
Yes. I think it would. Because I have Heimdall in a different jail and I thought all the network traffic currently right now within that jail would stay local. Even if I edit the Caddyfile in the Heimdall jail. Let's say when I type radarr.mydomain.us. How is my browser gonna know to either look into the Caddyfile within nextcloud or within heimdall?Do you think your DNS provider would need to communicate with the Heimdall jail?
I am trying. I just don't know where to start. That's why I am asking dumb questions. But I figure it wouldn't hurt to ask.This is basic stuff, listen to danb35 and study this before exposing your stuff online, setting up a VPN would probably be better
@garm and in which step and how do u upgrade?What I do (and its very scriptable), (1) put nextcloud in maintenance mode, (2) dump database and create snapshot of dataset for datastore and jail, (3) take nextcloud off maintenance mode, (4) backup datastore from snapshot, (5) backup application and database dump from snapshot
This method puts nextcloud out of action for just a few seconds and users general never notice it