VPS侦探论坛

 找回密码
 注册
查看: 10273|回复: 8

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

[复制链接]
发表于 2011-6-20 17:58:01 | 显示全部楼层 |阅读模式

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



百度爬虫
220.181.108.152 - - [17/Jun/2011:22:02:59 +0800] "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 - - [17/Jun/2011:22:03:01 +0800] "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 - - [17/Jun/2011:22:03:04 +0800] "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 - - [17/Jun/2011:22:03:06 +0800] "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 - - [20/Jun/2011:14:26:00 +0800] "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 - - [20/Jun/2011:14:26:08 +0800] "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 - - [20/Jun/2011:14:26:19 +0800] "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;
}


我怀疑这就是百度不收录我的原因,请各位老大帮忙解决一下小弟的打难题,小弟在这不胜感激!!
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
发表于 2011-6-20 19:05:10 | 显示全部楼层


这个不太清楚,如果301之后的网址 不对,应该是你的设置问题吧。
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
发表于 2011-6-21 12:31:27 | 显示全部楼层

上配置文件啊,不然怎么看啊。
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
 楼主| 发表于 2011-6-21 14:16:31 | 显示全部楼层



什么配置文件不对,是重定向配置吗
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
发表于 2011-6-21 15:42:31 | 显示全部楼层

贴配置看看

军哥运维代购:http://shop63846532.taobao.com/

 楼主| 发表于 2011-6-21 16:09:31 | 显示全部楼层

nginx.conf


  1. user  www www;
  2. worker_processes 1;
  3. error_log  /home/wwwlogs/nginx_error.log  crit;
  4. pid        /usr/local/nginx/logs/nginx.pid;
  5. #Specifies the value for maximum file descriptors that can be opened by this process.
  6. worker_rlimit_nofile 51200;
  7. events
  8. {
  9.   use epoll;
  10.   worker_connections 51200;
  11. }
  12. http
  13. {
  14.   include       mime.types;
  15.   default_type  application/octet-stream;
  16.   server_names_hash_bucket_size 128;
  17.   client_header_buffer_size 32k;
  18.   large_client_header_buffers 4 32k;
  19.   client_max_body_size 50m;
  20.   sendfile on;
  21.   tcp_nopush     on;
  22.   keepalive_timeout 60;
  23.   tcp_nodelay on;
  24.   fastcgi_connect_timeout 300;
  25.   fastcgi_send_timeout 300;
  26.   fastcgi_read_timeout 300;
  27.   fastcgi_buffer_size 64k;
  28.   fastcgi_buffers 4 64k;
  29.   fastcgi_busy_buffers_size 128k;
  30.   fastcgi_temp_file_write_size 256k;
  31.   gzip on;
  32.   gzip_min_length  1k;
  33.   gzip_buffers     4 16k;
  34.   gzip_http_version 1.0;
  35.   gzip_comp_level 2;
  36.   gzip_types       text/plain application/x-javascript text/css application/xml;
  37.   gzip_vary on;
  38.   #limit_zone  crawler  $binary_remote_addr  10m;
  39. server
  40. {
  41.                 listen       80;
  42.                 server_name down.7cds.info;
  43.                 index index.html index.htm index.php;
  44.                 root  /home/wwwroot;
  45.                
  46.       
  47.   location ~ .*\.(php|php5)?$
  48.    {
  49.     fastcgi_pass  unix:/tmp/php-cgi.sock;
  50.     fastcgi_index index.php;
  51.     include fcgi.conf;
  52.    }

  53.   location /status {
  54.    stub_status on;
  55.    access_log   off;
  56.   }

  57.   location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
  58.    {
  59.     expires      30d;
  60.    }
  61.   location ~ .*\.(js|css)?$
  62.    {
  63.     expires      12h;
  64.    }
  65.   log_format  access  '$remote_addr - $remote_user [$time_local] "$request" '
  66.              '$status $body_bytes_sent "$http_referer" '
  67.              '"$http_user_agent" $http_x_forwarded_for';
  68.   access_log  /home/wwwlogs/access.log  access;
  69. }
  70. include vhost/*.conf;
  71. }
复制代码

[ 本帖最后由 1vs1good 于 2011-6-21 16:10 编辑 ]
 楼主| 发表于 2011-6-21 16:12:53 | 显示全部楼层

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


  1. server
  2. {
  3.   listen       80;
  4.   server_name www.***cds.info;
  5.   index index.html index.htm index.php default.html default.htm default.php;
  6.   root  /home/wwwroot/7cds.info;
  7.   include discuzx.conf;
  8.   location ~ .*\.(php|php5)?$
  9.    {
  10.     fastcgi_pass  unix:/tmp/php-cgi.sock;
  11.     fastcgi_index index.php;
  12.     include fcgi.conf;
  13.    }
  14.   location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
  15.    {
  16.     expires      30d;
  17.    }
  18.   location ~ .*\.(js|css)?$
  19.    {
  20.     expires      12h;
  21.    }
  22.   access_log off;
  23. }
  24. server {
  25. server_name 7cds.info;
  26. rewrite ^/(.*) http://www.***cds.info/$1 permanent;
  27. }
复制代码
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
发表于 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/

没问题
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
 楼主| 发表于 2011-6-21 17:28:09 | 显示全部楼层


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

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

这是我返回状态

[root@225621 ~]# 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=/



  1. " 66.249.67.225 - - [20/Jun/2011:14:25:44 +0800] "GET /thread-2489-1-1.html HTTP/1.1" 301 185 "-" "Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)

  2. " 66.249.67.225 - - [20/Jun/2011:14:25:56 +0800] "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)

  3. " 66.249.67.225 - - [20/Jun/2011:14:26:00 +0800] "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)

  4. " 66.249.67.225 - - [20/Jun/2011:14:26:08 +0800] "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)

  5. " 221.221.46.224 - - [20/Jun/2011:14:26:19 +0800] "GET / HTTP/1.1" 301 185 "-" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)"

  6. "125.90.88.96 - - [20/Jun/2011:13:47:35 +0800] "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 编辑 ]

军哥运维代购:http://shop63846532.taobao.com/

您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|Archiver|VPS侦探 ( 鲁ICP备16040043号-1 )

GMT+8, 2024-12-7 18:57 , Processed in 0.029664 second(s), 16 queries .

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表