0

I'm currently attempting to serve Icinga from nginx. The new Icinga-Web ui attempts to load a file from URL http://SERVER/icinga-web/index.php/appkit/squishloader/javascript (leading to a 404). How do I setup a location for this scenario? How do I get nginx to serve index.php and pass the full request path in a way Icinga understands?

This is my current nginx config for icinga (adapted from the default apache config):

server {
        server_name SERVER;

        root /opt/icinga/icinga-1.2.1;

        location /icinga-web/js/ext3 {
                alias /opt/icinga/icinga-1.2.1/lib/ext3;
        }
        location /icinga-web {
                alias /opt/icinga/icinga-1.2.1/pub;
        }
        location /icinga/cgi-bin {
                alias /opt/icinga/icinga-1.2.1/sbin;
        }
        location /icinga {
                alias /opt/icinga/icinga-1.2.1/share;
        }
        location ~ \.php([\?/].*)?$ {
                include fastcgi_params;
                fastcgi_pass 127.0.0.1:61000;
                fastcgi_index   index.php;
                fastcgi_param   SCRIPT_FILENAME $document_root$fastcgi_script_name;
        }

}

Any thoughts? Thanks!

2 Answers2

0

Check logs. Try adding / to the end of path. URLs like index.php/something should work out of the box (since it just executes index.php file). If that doesn't work, try creating rewrite rule for it. Also maybe that will do the trick:

location ~ index\.php([\?/].*)?$ {
    include fastcgi_params;
    fastcgi_pass 127.0.0.1:61000;
    fastcgi_index index.php;
    fastcgi_param SCRIPT_FILENAME $document_root/index.php;
}
0

You need to setup virtual host with document root icinga-web.