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!
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 ^(.*) <a href="http://m.example.com/$domain">http://m.example.com/$domain</a> permanent;
}
if ($request_uri ~ ^\/index\.jsp\?d=2104$) {
rewrite ^(.*) <a href="http://m.example.com:8080/tv">http://m.example.com:8080/tv</a>? 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;
}
}