How To: emoncms on NginX & PHP5-FPM

Couldn't find a config for this anywhere so here's what worked for me:

server {
        listen  80;
        server_name your.ip.add.ress or domain.name;

        location / {
                root /path/to/emon;
                index index.php;
                rewrite ^/(.*)$ /index.php?q=$1 last;
        }

        location ~* ^.+.(jpg|jpeg|gif|css|png|js|ico|xml)$ {
                expires           30d;
                root /path/to/emon;
        }

        location ~ .php$ {
                fastcgi_split_path_info ^(.+.php)(.*)$;
                fastcgi_pass   php-daemon;
                fastcgi_index  index.php;
                fastcgi_param  SCRIPT_FILENAME  /path/to/emon$fastcgi_script_name;
                include fastcgi_params;
                fastcgi_intercept_errors        on;
                fastcgi_ignore_client_abort     off;
                fastcgi_connect_timeout 60;
                fastcgi_send_timeout 180;
                fastcgi_read_timeout 180;
                fastcgi_buffer_size 128k;
                fastcgi_buffers 4 256k;
                fastcgi_busy_buffers_size 256k;
                fastcgi_temp_file_write_size 256k;
        }

}

 

Rewrite above is very important to make it all work.
Just change the ip/domain name and change the "/path/to/emon" to your actual server path and it will work fine.

Myles