Yunohost installation behind caddy acting as a reverse proxy


I installed yunohost on my server, and it worked fine, if I create an SSH port forwarding to it, I can access it, but if I try accessing it from it’s domain name, I get a page saying “The page isn’t redirecting properly”.

At first I set up my domain name to be, but I couldn’t access it, then I added another domain name because I want created email addresses not to contain “yunohost.”.
Still I would like yunohost to be accessible from the browser through, because there are already other stuff on
Anyway, whichever of this configuration I tried, I couldn’t get to access yunohost in the browser through the domain name I set up.

The yunohost instance is installed in a virtual machine, I made all the necessary port forwardings from the main machine to the yunohost one (22, 25, 587, 993, 5222, 5269). Also I configured my router caddy like so: {
    proxy / myyunohostvm:80 {

which is the usual way I proxy services on the server towards virtual machines.

I think my DNS records are properly configured, they look like this:

# Basic ipv4/ipv6 records
@ 3600 IN A myIpv4
@ 3600 IN AAAA myIpv6
* 3600 IN A myIpv4
* 3600 IN AAAA myIpv6
yunohost 3600 IN CNAME

_xmpp-client._tcp 3600 IN SRV 0 5 5222
_xmpp-server._tcp 3600 IN SRV 0 5 5269
muc 3600 IN CNAME @
pubsub 3600 IN CNAME @
vjud 3600 IN CNAME @

# Mail (MX, SPF, DKIM and DMARC)
@ 3600 IN MX 5
@ 3600 IN TXT "v=spf1 a mx ip4:myIpv4 -all"
mail._domainkey 3600 IN TXT "v=DKIM1; h=sha256; k=rsa; p=loooooongkey"
_dmarc 3600 IN TXT "v=DMARC1; p=none"

# Mail
@ 3600 IN CAA 128 issue ""

Any suggestion of where the problem could come from is super welcome :slight_smile:


So uh, what about port 80 and 443 ?


@Aleks Yes, I never tried that, and it actually works to access yunohost yes.
But also it’s not a solution, because then caddy is bypassed and all the traffic that should be properly dispatched is redirected to yunohost vm.
In other words, it breaks every other services the main machine is handling.

The problem must come from the fact that caddy is automatically handling traffic encryption and https, and maybe yunohost is not able to handle that for some reason?


So actually the solution was in the caddy configuration that should look like so: {
  proxy / https://myyunohostvm {

For details, see here.