views:

15

answers:

1

I'm running nginx on my home computer for development. I also have it linked to DynDNS so I can show progress to my co-worker a bit easier. I can't seem to get nginx to rewrite to CodeIgniter properly. I have CodeIgniters uri_protocol set to REQUEST_URI.

All pages that should be showing up wtih content show up completely blank. If I phpinfo(); die(); in the index.php file of Codeigniter, it works as expected and I get the phpinfo.

Also, pages that should give a 404 give a proper CodeIgniter 404 error.

Here's what I have so far.

user www-data;
worker_processes  1;

error_log  /var/log/nginx/error.log;
pid        /var/run/nginx.pid;

events {
    worker_connections  1024;
    # multi_accept on;
}

http {
    include       /etc/nginx/mime.types;

    access_log  /var/log/nginx/access.log;
    error_log /var/log/nginx/error.log;

    sendfile        on;
    #tcp_nopush     on;

    #keepalive_timeout  0;
    keepalive_timeout  65;
    tcp_nodelay        on;

    #gzip  on;
    #gzip_disable "MSIE [1-6]\.(?!.*SV1)";

    root /home/zack/Development/public_html;

    include /etc/nginx/conf.d/*.conf;
    #include /etc/nginx/sites-enabled/*;


    server {
        listen 80;
        server_name zackhovatter.dyndns.info;

        index index.php;
        root /home/zack/Development/public_html;

        location /codeigniter/ {
            if (!-e $request_filename) {
                rewrite ^/codeigniter/(.*)$ /codeigniter/index.php/$1 last;
            }
        }
            #this is for the index.php in the root folder
        location /index.php {
            fastcgi_pass    127.0.0.1:9000;
            fastcgi_index   index.php;
            fastcgi_param   SCRIPT_FILENAME /home/zack/Development/public_html/index.php;
            include         fastcgi_params;
        }

        location /codeigniter/index.php {
            fastcgi_index   index.php;
            include         fastcgi_params;
            fastcgi_param   SCRIPT_FILENAME  /home/zack/Development/public_html/codeigniter/index.php;
            fastcgi_param   REQUEST_URI      $request_uri;
            fastcgi_param   QUERY_STRING     $query_string;
            fastcgi_param   PATH_INFO        $document_uri;
            fastcgi_param   REQUEST_METHOD   $request_method;
            fastcgi_param   CONTENT_TYPE     $content_type;
            fastcgi_param   CONTENT_LENGTH   $content_length;
            fastcgi_pass    127.0.0.1:9000;
        }
    }
}
A: 

Actually I got this working. Not sure how, but I think it was file permissions being set incorrectly or something.

Edit: For those who are wondering, I had an older version of PHP installed it seems. Reverting back to old class constructors fixed the issue. Darnit.

Zack