Skip to content

Instantly share code, notes, and snippets.

@wottpal
Last active November 15, 2018 19:20
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wottpal/e5913ed65cd0460fc4617c923d5c89e3 to your computer and use it in GitHub Desktop.
Save wottpal/e5913ed65cd0460fc4617c923d5c89e3 to your computer and use it in GitHub Desktop.
#######################
#######################
# KIRBY-CONFIGURATION #
# block content
location ~ ^/content/(.*).(txt|md|mdown)$
{
rewrite ^/content/(.*).(txt|md|mdown)$ /error redirect;
}
# block all files in the site folder from being accessed directly
location ~ ^/site/(.*)$
{
rewrite ^/site/(.*)$ /error redirect;
}
# block all files in the kirby folder
location ~ ^/kirby/(.*)$
{
rewrite ^/kirby/(.*)$ /error redirect;
}
# site links
location /
{
try_files $uri $uri/ /index.php?$uri&$args;
# cache static assets
if ($request_uri ~ \.(jpg|jpeg|png|gif|ico|svg|woff|ttf|woff2|otf|xml|pdf|eot|json)$) {
expires 1M;
access_log off;
add_header Cache-Control "public";
add_header Access-Control-Allow-Origin *;
}
}
# deny access to .htaccess files
location ~ /\.ht
{
deny all;
}
#######################
#######################
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment