Caddy redirecting and appending trailing slash with subdirectory/index.html?

Hello @Whitestrake,

I made a typo in my post, I meant “if possible without renaming the files”. I am using Nuxt as a framework and it requires the file structure I’ve shown for routing.

I tried to implement what was specified here, but I get a redirection problem (an infinite redirection I guess)

rewrite {
	if {path} not /
	if {path} ends_with /
	r ^/(.*)/$
	to /{1}
}

redir 301 {
	if {path} not /
	if {path} ends_with /
	/ {rewrite_uri}
}

Any way to prevent this 301 redirection? or to make the config above work? Or is it a hardcoded “feature” of Caddy?