Welcome Guest, Not a member yet? Register   Sign In
Problem with query strings using CodeIgniter with nginx
#1

[eluser]mptre[/eluser]
Hi!
I'm having troubles using CodeIgniter with nginx. The setup works fine until a request includes a query string. CodeIgniter then prompts me with a 404.

I've changed the URI protocol to REQUEST_URI in order to work with the CGI. See nginx config below.

Any ideas would be much appreciated! Thanks in advantage!

Code:
server {
    listen 8080;
    server_name *.example.com *.foo.com *.bar.com

    access_log /var/nginx/example.com/m.example.com/logs/access.log;
    error_log /var/nginx/example.com/m.example.com/logs/error.log;

    location / {
        root /var/nginx/example.com/m.example.com/public/current;
        index index.php index.html;

        if (-f $request_filename) {
            break;
        }

        if ($request_filename ~ ^googleb57511441f2b72e1\.html$) {
            break;
        }

        if ($host ~ .*\.(foo|bar)\.com) {
            set $domain $1;
            rewrite ^(.*) http://m.example.com/$domain permanent;
        }

        if ($request_uri ~ ^\/index\.jsp\?d=2104$) {
            rewrite ^(.*) http://m.example.com:8080/tv? permanent;
        }

        if (!-e $request_filename) {
            rewrite ^(.*)$ /index.php?$1 last;
        }
    }

    location /index.php {
        fastcgi_pass 127.0.0.1:9000;
        fastcgi_index index.php;
        fastcgi_param SCRIPT_FILENAME /var/nginx/example.com/m.example.com/public/current/index.php;
        include /etc/nginx/fastcgi_params;
    }
}


Messages In This Thread
Problem with query strings using CodeIgniter with nginx - by El Forum - 09-29-2010, 07:54 AM
Problem with query strings using CodeIgniter with nginx - by El Forum - 09-29-2010, 02:16 PM
Problem with query strings using CodeIgniter with nginx - by El Forum - 10-22-2010, 06:05 AM
Problem with query strings using CodeIgniter with nginx - by El Forum - 10-29-2010, 07:34 AM



Theme © iAndrew 2016 - Forum software by © MyBB