1vs1good 发表于 2011-6-20 17:58:01

nginx301重定向重大问题大家帮帮忙

事情原因:谷歌收录3万+百度一个都没有收录
军哥各位高手请帮忙分析一下下面搜索引擎爬虫的日志:



百度爬虫
220.181.108.152 - - "GET /home-space-uid-1159-do-album-view-me-from-space.html HTTP/1.1" 301 185 "-" "Mozilla/5.0 (compatible; Baiduspider/2.0; +http://www.baidu.com/search/spider.html)"

220.181.108.151 - - "GET /home-space-uid-1159-do-album-view-me.html HTTP/1.1" 301 185 "-" "Mozilla/5.0 (compatible; Baiduspider/2.0; +http://www.baidu.com/search/spider.html)"

220.181.108.150 - - "GET /home-space-uid-1213-do-profile-view-me.html HTTP/1.1" 301 185 "-" "Mozilla/5.0 (compatible; Baiduspider/2.0; +http://www.baidu.com/search/spider.html)"

220.181.108.144 - - "GET /home-space-uid-1213-do-friend-view-me.html HTTP/1.1" 301 185 "-" "Mozilla/5.0 (compatible; Baiduspider/2.0; +http://www.baidu.com/search/spider.html)"

谷歌爬虫
66.249.67.225 - - "GET /home-space-uid-603-do-share-view-me-type-article.html HTTP/1.1" 301 185 "-" "Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)"

66.249.67.225 - - "GET /home-space-uid-883-do-home-view-me-from-space.html HTTP/1.1" 301 185 "-" "Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)"

221.221.46.224 - - "GET / HTTP/1.1" 301 185 "-" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)"

后来我用curl -I imcat.tk 命令看了一下301重定向出现我意想不到的结果:


Server: nginx/0.8.52
Date: Mon, 20 Jun 2011 09:43:38 GMT
Content-Type: text/html
Content-Length: 185
Connection: keep-alive
Location: http://omnia.me/ ——————这个网址根本就不是我的


我只做了 不带WWW重定向到 带WWW 上面
下面是我的代码

server {
server_name 123.info;
rewrite ^/(.*) http://www.123.info/$1 permanent;
}

我怀疑这就是百度不收录我的原因,请各位老大帮忙解决一下小弟的打难题,小弟在这不胜感激!!

licess 发表于 2011-6-20 19:05:10

这个不太清楚,如果301之后的网址 不对,应该是你的设置问题吧。

yuweitaocn 发表于 2011-6-21 12:31:27

上配置文件啊,不然怎么看啊。

1vs1good 发表于 2011-6-21 14:16:31

什么配置文件不对,是重定向配置吗

licess 发表于 2011-6-21 15:42:31

贴配置看看

1vs1good 发表于 2011-6-21 16:09:31

nginx.conf


userwww www;
worker_processes 1;
error_log/home/wwwlogs/nginx_error.logcrit;
pid      /usr/local/nginx/logs/nginx.pid;
#Specifies the value for maximum file descriptors that can be opened by this process.
worker_rlimit_nofile 51200;
events
{
use epoll;
worker_connections 51200;
}
http
{
include       mime.types;
default_typeapplication/octet-stream;
server_names_hash_bucket_size 128;
client_header_buffer_size 32k;
large_client_header_buffers 4 32k;
client_max_body_size 50m;
sendfile on;
tcp_nopush   on;
keepalive_timeout 60;
tcp_nodelay on;
fastcgi_connect_timeout 300;
fastcgi_send_timeout 300;
fastcgi_read_timeout 300;
fastcgi_buffer_size 64k;
fastcgi_buffers 4 64k;
fastcgi_busy_buffers_size 128k;
fastcgi_temp_file_write_size 256k;
gzip on;
gzip_min_length1k;
gzip_buffers   4 16k;
gzip_http_version 1.0;
gzip_comp_level 2;
gzip_types       text/plain application/x-javascript text/css application/xml;
gzip_vary on;
#limit_zonecrawler$binary_remote_addr10m;
server
{
                listen       80;
                server_name down.7cds.info;
                index index.html index.htm index.php;
                root/home/wwwroot;
               
      
location ~ .*\.(php|php5)?$
   {
    fastcgi_passunix:/tmp/php-cgi.sock;
    fastcgi_index index.php;
    include fcgi.conf;
   }

location /status {
   stub_status on;
   access_log   off;
}

location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
   {
    expires      30d;
   }
location ~ .*\.(js|css)?$
   {
    expires      12h;
   }
log_formataccess'$remote_addr - $remote_user [$time_local] "$request" '
             '$status $body_bytes_sent "$http_referer" '
             '"$http_user_agent" $http_x_forwarded_for';
access_log/home/wwwlogs/access.logaccess;
}
include vhost/*.conf;
}

[ 本帖最后由 1vs1good 于 2011-6-21 16:10 编辑 ]

1vs1good 发表于 2011-6-21 16:12:53

***cds.info.conf域名被涂改


server
{
listen       80;
server_name www.***cds.info;
index index.html index.htm index.php default.html default.htm default.php;
root/home/wwwroot/7cds.info;
include discuzx.conf;
location ~ .*\.(php|php5)?$
   {
    fastcgi_passunix:/tmp/php-cgi.sock;
    fastcgi_index index.php;
    include fcgi.conf;
   }
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
   {
    expires      30d;
   }
location ~ .*\.(js|css)?$
   {
    expires      12h;
   }
access_log off;
}
server {
server_name 7cds.info;
rewrite ^/(.*) http://www.***cds.info/$1 permanent;
}

licess 发表于 2011-6-21 17:20:41

# curl --head ***cds.info
HTTP/1.1 301 Moved Permanently
Server: nginx/0.8.54
Date: Tue, 21 Jun 2011 09:18:47 GMT
Content-Type: text/html
Content-Length: 185
Connection: keep-alive
Location: http://www.***cds.info/

没问题

1vs1good 发表于 2011-6-21 17:28:09

谢谢军哥 难到我用curl -I imcat.tk 这个命令不对?

下面是搜索引擎爬行记录我整个日志文件夹都是 HTTP/1.1" 301 185 提示 现在就是谷歌收录4万+ 百度一个都没有!

这是我返回状态

# curl --head www.******.info
HTTP/1.1 200 OK
Server: nginx/0.8.54
Date: Tue, 21 Jun 2011 09:23:41 GMT
Content-Type: text/html; charset=gbk
Connection: keep-alive
Vary: Accept-Encoding
X-Powered-By: PHP/5.2.17
Set-Cookie: mEaA_2132_lastvisit=1308644621; expires=Thu, 21-Jul-2011 09:23:41 GMT; path=/
Set-Cookie: mEaA_2132_sid=UO5fhF; expires=Wed, 22-Jun-2011 09:23:41 GMT; path=/
Set-Cookie: mEaA_2132_lastact=1308648221%09index.php%09; expires=Wed, 22-Jun-2011 09:23:41 GMT; path=/



" 66.249.67.225 - - "GET /thread-2489-1-1.html HTTP/1.1" 301 185 "-" "Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)

" 66.249.67.225 - - "GET /home-space-uid-996-do-album-view-me.html HTTP/1.1" 301 185 "-" "Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)

" 66.249.67.225 - - "GET /home-space-uid-603-do-share-view-me-type-article.html HTTP/1.1" 301 185 "-" "Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)

" 66.249.67.225 - - "GET /home-space-uid-883-do-home-view-me-from-space.html HTTP/1.1" 301 185 "-" "Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)

" 221.221.46.224 - - "GET / HTTP/1.1" 301 185 "-" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)"

"125.90.88.96 - - "GET / HTTP/1.1" 301 185 "-" "Mozilla/5.0 (compatible; Baiduspider/2.0; +http://www.baidu.com/search/spider.html)

[ 本帖最后由 1vs1good 于 2011-6-21 17:32 编辑 ]
页: [1]
查看完整版本: nginx301重定向重大问题大家帮帮忙