Hello,
I am using caddy in a Laradock container, I already have a Laravel project running perfectly (including subdomains).
But now I need to add another Laravel project (it will run as a subdomain), but after configuring it and restarting the caddy, no domain runs anymore.
====================================
It works:
https://domain1.com.br, https://www.domain1.com.br {
# root /var/www/public
root /var/www/project1/public
fastcgi / php-fpm:9000 php {
index index.php
}
# To handle .html extensions with laravel change ext to
# ext / .html
rewrite {
to {path} {path}/ /index.php?{query}
}
gzip
browse
log /var/www/project1/storage/logs/caddy-access.log
errors /var/www/project1/storage/logs/caddy-error.log
# Uncomment to enable TLS (HTTPS)
# Change the first list to listen on port 443 when enabling TLS
#tls self_signed
tls email@mail.com
# To use Lets encrpt tls with a DNS provider uncomment these
# lines and change the provider as required
#tls {
# dns cloudflare
#}
}
https://subdomain1.domain1.com.br {
root /var/www/project1_app/dist/spa
rewrite {
regexp .*
to {path} /
}
# rewrite {
# to {path} {path}/ /index.html
# }
}
============================
It does not work :
https://domain1.com.br, https://www.domain1.com.br {
# root /var/www/public
root /var/www/project1/public
fastcgi / php-fpm:9000 php {
index index.php
}
# To handle .html extensions with laravel change ext to
# ext / .html
rewrite {
to {path} {path}/ /index.php?{query}
}
gzip
browse
log /var/www/project1/storage/logs/caddy-access.log
errors /var/www/project1/storage/logs/caddy-error.log
# Uncomment to enable TLS (HTTPS)
# Change the first list to listen on port 443 when enabling TLS
#tls self_signed
tls email@mail.com
# To use Lets encrpt tls with a DNS provider uncomment these
# lines and change the provider as required
#tls {
# dns cloudflare
#}
}
https://subdomain1.domain1.com.br {
root /var/www/project1_app/dist/spa
rewrite {
regexp .*
to {path} /
}
# rewrite {
# to {path} {path}/ /index.html
# }
}
New domain ======================
https://subdomain2.domain1.com.br {
# root /var/www/public
root /var/www/project2/public
fastcgi / php-fpm:9000 php {
index index.php
}
# To handle .html extensions with laravel change ext to
# ext / .html
rewrite {
to {path} {path}/ /index.php?{query}
}
gzip
browse
log /var/www/project2/storage/logs/caddy-access.log
errors /var/www/project2/storage/logs/caddy-error.log
# Uncomment to enable TLS (HTTPS)
# Change the first list to listen on port 443 when enabling TLS
#tls self_signed
tls email@mail.com
# To use Lets encrpt tls with a DNS provider uncomment these
# lines and change the provider as required
#tls {
# dns cloudflare
#}
}
Sorry for the english