Hi giopas,
At the moment my QNAP+Caddy setup is working 100% correctly due to the reasons that I have specified in my previous post. I am aware that with the Caddy update on QTS that the config file was set back to default, but my issue began before the Caddy update and remained after the update. My issue was caused by a QTS update, seperate from the Caddy update. I appreciate you trying to help though.
I pretty much learned how to setup Caddy in https via this thread with much thanks going to Whitestrake for answering all of my questions. I was a complete noob when I started this thread and he helped me from not having any understanding at all to making it work 100%.
The great thing about Caddy is that it does all the HTTPS stuff by itself and you just need to setup the caddyfile pretty much. As long as your caddyfile is correct and your ports are forwarded, caddy does the rest.
My caddyfile is as follows:
mynashere.myqnapcloud.com
root /home/Qhttpd/
gzip
proxy /radarr http://localhost:7878 { # https://radarr.video/
transparent
header_upstream X-Forwarded-Host {host}
}
proxy /sonarr http://localhost:8989 { # https://sonarr.tv/
transparent
header_upstream X-Forwarded-Host {host}
}
proxy /nzbget http://localhost:6789 { # http://nzbget.net/
transparent
header_upstream X-Forwarded-Host {host}
}
proxy / localhost:8080 { # blank
transparent
header_upstream X-Forwarded-Host {host}
}
}
The last part is the part that forwards the main QTS admin home page. Then inside my Caddy.sh file I have this line which runs Caddy with my caddyfile at every boot:
caddy -conf /share/CACHEDEV1_DATA/.qpkg/Caddy/Caddyfile -agree -log $QPKG_ROOT/var/logs/caddy.log -pidfile /var/run/caddy.pid &
Using this configuration along with the QTS settings of:
myQNAPCloud, Auto Router Configuration - Port 80 and Port 443 TCP forwarded
I also have NAS Web & Web Server, Multimedia Station forwarded to 8080 and 86. 8080 is the Nas Web that QTS forwards to, with caddy it will become HTTPS. 86 is my HTTP backup that can work without caddy.
You don’t need to use port 86, but you will need to go into Control Panel, Applications, Web Server & change the port from 80, otherwise caddy cannot use port 80. Also disable HTTPS there and also in System, General Settings. Caddy will manage HTTPS so you need to turn off QNAPs.
DDNS enabled using myqnapcloud url
SSL Certificate disabled and OFF (Caddy will manage this)
These are the settings I am using to successfully use QNAP+Caddy. Note that for other apps like Radarr, Sonarr etc, you need to configure them to have an URL base like /radarr so that it’s 192.0.0:1234/radarr rather than just 192.0.0:1234
I hope this helps.