Serving static folders (pass through routing)

Hi guys, I’m trying to serve some content from a folder sitting in the website root called tools.

This folder would contain subfolder, each one of them containing its own index.html, CSS and JS – but Kirby is of course catching the URL and trying to pull the actual content of it, which doesn’t exist in the /content folder.

Is there a way to tell Kirby to let some paths come through, directly, instead of running them through the usual Kirby pipeline?

Do you get a Kirby error page?

Yes, the usual page not found error page.

Hm, but according to these .htaccess rules

# make site links work
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*) index.php [L]

requests are only passed through. the index file if the requested file/folder doesn’t exist.

Edit :

In a local test and on a shared hosting server, I could access such an extra folder without any problems.

I’m using nginx, at this point I’m getting suspicious the rules are not 1:1 with the ones in the .htaccess – I’ll investigate further, and post back my findings.

For the moment, thank you for this pointer, I think this might be the culprit.

Changing

location / {
    rewrite ^.*$ /index.php;
}

into

location / {
  try_files $uri $uri/ /index.php?$uri&$args;
}

Worked. So it indeed was a wrongly translated directive from .htaccess to nginx.
I did (unfortunately) without understanding much the differences between the two and the reason why this works stays a bit obscure to me. I just sniffed around a tried a few options.

If anybody knows the meaning of this change, sharing it would enrich this post considerably.
Thanks for the help.

http://nginx.org/en/docs/http/ngx_http_core_module.html#try_files

The second example checks the existence of the files first and only redirects if they don’t exist.

Hey, for reference, here is our nginx config that is used in production.

This config supports the SRI and cache busting plugin: https://github.com/S1SYPHOS/kirby-sri

And here is my http to https redirect site.