Error running multiple Laravel projects

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

Hi @MaxMax, welcome to the Caddy community.

Could you post Caddy’s output from after you restarted it with the new configuration?

Apparently it was a problem in project2, redid the installation and now everything is ok.

Sorry for opening this topic

Nah, no worries. Let us know if you run into any other Caddy trouble.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.