How do I handle a request for "index.php/somepath" in Nginx config?

Posted by Arne on Server Fault See other posts from Server Fault or by Arne
Published on 2010-12-16T18:26:23Z Indexed on 2011/03/12 8:11 UTC
Read the original article Hit count: 354

Filed under:
|

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!

© Server Fault or respective owner

Related posts about nginx

Related posts about icinga