Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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!

share|improve this question

2 Answers 2

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;
}
share|improve this answer

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

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.