0

After successfully setting up nginx on my windows, another problem where I am stuck. Though, everything works as usual. I am able to access pages and PHP works fine but problem comes when I try to use Codeigniter type urls, by which, I mean,

https://localhost/index.php/<controller>

Even if I insert one slash after "index.php" an error No input file specified is thrown which I think means the FastCGI server is not able to catch the right file. Here is my config file,

server {
    server_name localhost;
    listen 443; 
    root /wamp/www/;

    ssl on;
    ssl_certificate /wamp/www/server.crt;
    ssl_certificate_key /wamp/www/server.key;

    location / {        
        index index.php index.html index.htm;
    }

    location /NavHawk2 {
        try_files $uri $uri/ index.php/;
    }

    # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
    #
    location ~ \.php$ {
            fastcgi_intercept_errors on;
            fastcgi_pass   127.0.0.1:9000;
            fastcgi_index  index.php;
            fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
            include        fastcgi_params;
    }
}

Nothing in error logs and access logs are filled with 404 requests. If I remove the try_files line, I get a nginx 404 page.

1
  • 1
    And I really hope this is a development site. You don't want to place your real SSL private key certificate in the document root where anybody can download them. May 19, 2013 at 15:17

1 Answer 1

1

Looks like you need to use fastcgi_split_path_info.

An example:

fastcgi_split_path_info       ^(.+\.php)(.*)$;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO       $fastcgi_path_info;

Not the answer you're looking for? Browse other questions tagged .