Hi, I am trying to convert the following nginx code
location / {
auth_basic "Restricted Content";
auth_basic_user_file /var/www/.htpasswd;
if (!-e $request_filename){
rewrite ^(/)?customer/.*$ /customer/index.php;
}
if (!-e $request_filename){
rewrite ^(/)?backend/.*$ /backend/index.php;
}
if (!-e $request_filename){
rewrite ^(.*)$ /index.php;
}
index index.html index.htm index.php;
# try_files $uri $uri/ /index.php$is_args$args;
}
to a caddy equivalent.
Here is the .htaccess code for it
#php_value default_charset UTF-8
#AddDefaultCharset UTF-8
#make sure nothing can be seen inside!
deny from all
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php?/$1 [L]
I tried doing
{
root /var/www
fastcgi / php-fpm:9000 php {
index index.php
}
# To handle .html extensions with laravel change ext to
# ext / .html
rewrite ^(/)?customer/.*$ /customer/index.php
rewrite ^(/)?backend/.*$ /backend/index.php
rewrite ^(.*)$ /index.php
gzip
browse
log /var/log/caddy/access.log
errors /var/log/caddy/error.log
# Uncomment to enable TLS (HTTPS)
# Change the first list to listen on port 443 when enabling TLS
tls mymail@gmail.com
# To use Lets encrpt tls with a DNS provider uncomment these
# lines and change the provider as required
#tls {
# dns cloudflare
#}
}
But It brought up a lot of errors for them.