Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

rewrite or internal redirection cycle while processing "/index.php",

My Nginx.conf file as follow:

user www-data;
worker_processes 4;
pid /var/run/nginx.pid;

events {
    worker_connections 768;
    # multi_accept on;
}

http {

    ##
    # Basic Settings
    ##
    sendfile on;
    #tcp_nopuish on;
    tcp_nodelay on;
    keepalive_timeout 2;
    types_hash_max_size 2048;
    # server_tokens off;

    # server_names_hash_bucket_size 64;
    # server_name_in_redirect off;

    include /etc/nginx/mime.types;
    #default_type application/octet-stream;

    ##
    # Logging Settings
    ##

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

    ##
    # Gzip Settings
    ##

    gzip on;
    gzip_disable "msie6";

    # gzip_vary on;
    # gzip_proxied any;
    # gzip_comp_level 6;
    # gzip_buffers 16 8k;
    # gzip_http_version 1.1;
    # gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript;

    ##
    # nginx-naxsi config
    ##
    # Uncomment it if you installed nginx-naxsi
    ##

    #include /etc/nginx/naxsi_core.rules;

    ##
    # nginx-passenger config
    ##
    # Uncomment it if you installed nginx-passenger
    ##

    #passenger_root /usr;
    #passenger_ruby /usr/bin/ruby;

    ##
    # Virtual Host Configs
    ##

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

and default.conf is as follows:

server {
        listen   80;
        client_max_body_size 20M;

        root /usr/share/nginx/www/;
        index index.php index.html index.htm;

        server_name _;

        location / {
               # try_files $uri $uri/ /index.html;
         index index.html index.php;    
        try_files $uri $uri/ @handler;
        #try_files $uri $uri/ =404;
        }
    location @handler {
            rewrite / /index.php;
    }

    #location /index.html {
        #   rewrite ^ /index.html break;
    #} ##changes by rahul

        error_page 404 /404.html;

        error_page 500 502 503 504 /50x.html;
        location = /50x.html {
              root /usr/share/nginx/www;
        }

        # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
        location ~ \.php$ {

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

        fastcgi_split_path_info ^(.+\.php)(/.+)$;
                #fastcgi_pass 127.0.0.1:9000;
                # With php5-fpm:
                fastcgi_pass unix:/var/run/php5-fpm.sock;
                fastcgi_index index.php;
                fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
                include fastcgi_params;

        }

}

got error while browsing site:

2013/08/01 10:54:41 [error] 3479#0: *16 rewrite or internal redirection cycle while processing "/index.php", 
share|improve this question
    
So.. does it always happen, or for just certain requests, or just some of the time? What changed? How long has it been having problems? –  Shane Madden Aug 1 '13 at 5:39
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.