caddy
jail. Alternatively, though less desirable, you can use the main Shell
in the FreeNAS/TrueNAS GUI. The instructions also assume that you don't just follow instructions blindly, but understand what the intent is behind each step.iocage console caddy
caddy version
. If it isn't, at least, the official version, continue.exit
.caddy-config
from the time you last built the Caddy V2 jail. Save a copy of it. If you can't find it, reconstruct it before proceeding to the next step. You can use the current jail characteristics to help you recreate it. It's a good idea to keep a copy of this file somewhere. It comes in handy each time you need to rebuild the Caddy jail.iocage destroy caddy -f
. Your Caddyfile
resides outside the jail and won't be affected. (If you're paranoid, rename the jail instead of destroying it first, alter the renamed jail to use DHCP to avoid an IP conflict when for the rebuilt jail, and save a copy of your Caddyfile
).caddy-config
from step 4, use it to rebuild the Caddy jail.Caddyfile
. Confirm that your resources behind the Caddy reverse proxy are still accessible.
So I just did this, this morning--I used my New and Improved™ Heimdall script (now with Caddy2 goodness!) to set up a new Heimdall jail, replacing my existing Caddy and Heimdall jails (which I had separate, as I'd set up Caddy before playing with Heimdall). And being a reckless sort, I just blew away the old jails (though I kept a copy of the old Caddyfile from the Caddy jail). Now the Caddy instance in the Heimdall jail is handling the reverse-proxy needs as well. Adding all that to the stock Caddyfile (for about a dozen apps, TLS, DNS validation with Cloudflare) took no more than about 15 minutes.Be prepared to spend some time reworking your Caddyfile
Probably the same issue as this:The caddy-jail script now seems to break at line 125 due to the new version of go
You haven't given forum members much to work with. I think you need to be explicit and explain exactly what you're trying to achieve, but please be aware of this Caddy README extract as well...please...
Though we'll try to help on that thread, once Caddy's up and running, the Caddy forum is likely to be a better resource for its configuration, particularly with applications whose reverse proxy settings prove to be difficult. Once you have something working, though, please post back in the iXSystems forum.
domain1.com { file_server root * /usr/local/www/domain1/ } domain2.com { file_server root * /usr/local/www/domain2/ php_fastcgi localhost:9000 } ...
As Basil says (and as the README he quoted says), the Caddy forum is really the place to asking questions about how to make Caddy do what you want it to do. But if you want to use PHP, you'll need to have it installed in the jail--the script doesn't do that.
Edit: But multiple domains are trivial in a Caddyfile:
Code:domain1.com { file_server root * /usr/local/www/domain1/ } domain2.com { file_server root * /usr/local/www/domain2/ php_fastcgi localhost:9000 } ...
HTTP ERROR 502
nextcloud.mydomain.com {
tls {
dns cloudflare pvuBLABLA...auG5I2zk68dwnoNg2utqOHlMaO4Me
}
reverse_proxy 192.168.1.96:80
}
![]()
How to Install and Configure Caddy Web Server with PHP and MariaDB on Ubuntu 20.04
Caddy Web Server is a modern open-source web server written in GO language. In this tutorial, youll install and configure Caddy to run along with PHP...www.howtoforge.com
caddy-config
and the Caddyfile for your Caddy reverse proxy, with any credentials redacted.Now i have another problem, my 443 and 80 port is redirected to the nextcloud jail created with your script time ago, how to redirect visitors of port 80 and 443 throught nextcloud jail or the other two pages (another caddy jail) with domain1 and domain2 like you say.