Nginx Raspberry Pi installation

Hello All,

I’m currently trying to install Kirby with Nginx on a Raspberry Pi. Unfortunately it does not work at all.
All links starting with ‘http://localhost’ are broken. For example the landing page cannot find the css file, the panel link is broken etc.
I guess it has something to do with my nginx config, but I can’t figure out what is going wrong.

This is my current nginx default file:

server {
listen 80 default_server; ## listen for ipv4; this line is default and implied
#listen [::]:80 default_server ipv6only=on; ## listen for ipv6

    root /usr/share/nginx/www/kirby;
    index index.php index.html index.htm;
    # Make site accessible from http://localhost/
    server_name localhost;
    location / {
            # First attempt to serve request as file, then
            # as directory, then fall back to displaying a 404.
            try_files $uri $uri/ /index.html;
            # Uncomment to enable naxsi on this location
            # include /etc/nginx/naxsi.rules
    }

location /kirby/ {
include /etc/nginx/mime.types;
index index.php;

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/panel {
if (!-e $request_filename) {
rewrite ^/(.*)$ /subdirectory/panel/index.php last;
break;
}

try_files $uri $uri/ /index.html;
}

Also I’m not sure, if need to use the .htaccess from kirby since I’m going to use nginx and not apache. Honestly speaking, I’m a little confused about the whole installation process on the Pi…

I would be glad, if someone could point me into the right direction.

Thanks!

The .htaccess file is an Apache file and does not make sense on nginx. Do you know the example nginx configuration: https://gist.github.com/bastianallgeier/c2e1f1e519f5f2943ec4

Other than that, there are a few examples here in the forum, which you might want to check out.