1. Caddy version (caddy version
):
Caddy version v2.1.1 h1:X9k1+ehZPYYrSqBvf/ocUgdLSRIuiNiMo7CvyGUQKeA=
2. How I run Caddy:
Caddy runs as a web server on port 80 and 443
a. System environment:
Ubuntu 18
b. Command:
sudo systemctl reload caddy
c. Service/unit/compose file:
paste full file contents here
d. My complete Caddyfile or JSON config:
{
email john@***.com
}
(common) {
encode gzip
php_fastcgi unix//run/php/php7.4-fpm.sock
file_server
}
sandbox.online {
root * /var/www
import common
log {
output file /var/log/caddy/sandbox.log
format console
}
}
maa.sandbox.online {
root * /var/www/maar
import common
log {
output file /var/log/caddy/maarifa.log
format console
}
}
3. The problem I’m having:
I have a .git folder on the root, how do I block it from being access from the browser.
I have done, sudo chmod 760 .git/ it works but I want to put a configuration in the Caddy file so that other dev who may forget to change permission, it will not access .git.
Also know to to restrict access to certain folders.
Thank you.