Detects that the server is redirecting the address request cycle
liushaobo
nginx-forum at nginx.us
Tue Sep 13 11:32:06 UTC 2011
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: http://forum.nginx.org/read.php?2,215139,215139#msg-215139
More information about the nginx
mailing list