Detects that the server is redirecting the address request cycle

hi all

add " if ($http_referer ~* “www.test.com”) {
rewrite ^/(.*)$ http://www.xxx.com permanent;
}"

open browser 出现 “
This redirect page is incorrect
Detects that the server is redirecting the address request cycle“

remove " if ($http_referer ~* “www.test.com”) {
rewrite ^/(.*)$ http://www.xxx.com permanent;
}"
are normal

nginx server config

server {
listen 80;
server_name www.xxx.com;
index index.htm index.html index.php;
root /www/xxx;

    log_format  wwwlogs  '$remote_addr - $remote_user [$time_local]

“$request” ’
'$status $body_bytes_sent “$http_referer” ’
‘“$http_user_agent” $http_x_forwarded_for’;
access_log /data0/logs/wwwlogs.log;

    location ^~ /index.php/mo {
            rewrite    ^/(.*)$    http://mo.xxx.com    permanent;
    }

   if ($http_referer ~* "www.test.com") {
            rewrite    ^/(.*)$       http://www.xxx.com permanent;
    }

    location ~* \.php {
            fastcgi_pass 127.0.0.1:9000;
            fastcgi_index index.php;
            include fcgi.conf;
            fastcgi_param REQUEST_URI $fastcgi_script_name;
            fastcgi_param SCRIPT_FILENAME

$document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_script_name;
}

    location ~* \.(jpg|png|jpeg|bmp|gif|swf|js|css) {
            expires 7d;
    }

    location ~* \.apk$ {
            limit_rate 80k;
    }

rewrite ^/web/soft/index/category/(\d+)/?$ /category/$1 permanent;
rewrite ^/web/allSoft/soft/category/(\d+)/?$ /apk/list/$1

permanent;
rewrite ^/web/allSoft/soft/category/(\d+)/order/download_count/?$
/apk/list/$1?order=download_count permanent;
rewrite ^/web/allSoft/soft/category/(\d+)/order/release_time/?$
/apk/list/$1?order=release_time permanent;
rewrite ^/web/soft/show/id/(\d+)/?$ /apk/detail/$1 permanent;
rewrite ^/web/default/apk/id/(\d+)/?$ /apk/download/$1 permanent;
rewrite ^/web/allSoft/rec/?$ /apk/recommended permanent;
rewrite ^/web/search/all/q/(.)/?$ /search?q=$1 permanent;
rewrite ^/web/rom/index/brand/(\d+)/?$ /rom/brand/$1 permanent;
rewrite ^/web/rom/index/?$ /rom permanent;
rewrite ^/web/rom/device/id/(\d+)/?/$ /rom/device/$1 permanent;
rewrite ^/web/rom/list/category/(.
)/device/(\d+)/?$ /rom/list/$1/$2
permanent;
rewrite ^/web/rom/show/id/(\d+)/?$ /rom/detail/$1 permanent;
rewrite ^/web/rom/api/level/(.*)/?$ /rom/level/$1 permanent;
rewrite ^/web/rom/download/id/(\d+)/?$ /rom/download/$1 permanent;

Posted at Nginx Forum:

Hello!

On Tue, Sep 13, 2011 at 07:32:06AM -0400, liushaobo wrote:

remove " if ($http_referer ~* “www.test.com”) {
rewrite ^/(.*)$ http://www.xxx.com permanent;
}"
are normal

You’ve asked nginx to do infinite redirect, and you’ve got it.
It’s not clear what you are asking about.

Maxim D.

在 2011-09-13二的 15:35 +0400,Maxim D.写道:

open browser 出现 “

Maxim D.


nginx mailing list
[email protected]
nginx Info Page

well,the OP make nginx into DEAD-CYCLE while $Http_Refer equals the site
rewrite/redirect to.

i guess that the OP should do something on regex of $Http_refer.


Best regards,
Sharl.Jimh.Tsin (From China Obviously Taiwan INCLUDED)

Using Gmail? Please read this important notice:
http://www.fsf.org/campaigns/jstrap/gmail?10073.