Skip to content

Instantly share code, notes, and snippets.

@ramv
Created March 6, 2014 23:49
Show Gist options
  • Save ramv/9402198 to your computer and use it in GitHub Desktop.
Save ramv/9402198 to your computer and use it in GitHub Desktop.
Kirby NGINX configuration
##############################
## Kirby configuration
##############################
location /kirby/ {
include /etc/nginx/mime.types;
index index.php;
root /var/www/addons88/;
if (!-e $request_filename){
rewrite ^/kirby/panel/(.*) /kirby/panel/index.php break;
}
if (!-e $request_filename) {
rewrite ^/kirby/(.*)$ /kirby/index.php last;
break;
}
location ~ \.php$ {
try_files $uri =404;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_script_name;
include fastcgi_params;
}
location /kirby/content {
rewrite ^/kirby/content/(.*)\.(txt|md|mdown)$ /kirby/error redirect;
}
location /kirby/site {
rewrite ^/kirby/site/(.*) /kirby/error redirect;
}
location /kirby/kirby {
rewrite ^/kirby/kirby/(.*) /kirby/error redirect;
}
location /kirby/robots {
rewrite ^/kirby/robots.txt /kirby/robots.txt break;
}
}
#############################
## End Kirby CMS configuration
##############################
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment