Сервер отдает 404 для Googlebot-Image/1.0 HTTP/1.0

12
iccup
На сайте с 01.05.2016
Offline
195
#11
coolwebsearcher:
в логах различие только в коде ответа и ип?

[root@ns1234 ~]# curl -v -I --http1.0 --user-agent "Googlebot-Image/1.0"  http://www.domain.com/images/image.jpg

* About to connect() to www.domain.com port 80 (#0)
* Trying 123.123.123.12... connected
* Connected to www.domain.com (123.123.123.12) port 80 (#0)
> HEAD /images/image.jpg HTTP/1.0
> User-Agent: Googlebot-Image/1.0
> Host: www.domain.com
> Accept: */*
>
< HTTP/1.1 200 OK
HTTP/1.1 200 OK
< Server: nginx/1.12.2
Server: nginx/1.12.2
< Date: Thu, 11 Oct 2018 15:06:21 GMT
Date: Thu, 11 Oct 2018 15:06:21 GMT
< Content-Type: image/jpeg
Content-Type: image/jpeg
< Content-Length: 458344
Content-Length: 458344
< Last-Modified: Wed, 12 Apr 2017 00:52:30 GMT
Last-Modified: Wed, 12 Apr 2017 00:52:30 GMT
< Connection: close
Connection: close
< ETag: "58ed7a4e-6fe68"
ETag: "58ed7a4e-6fe68"
< Expires: Thu, 18 Oct 2018 15:06:21 GMT
Expires: Thu, 18 Oct 2018 15:06:21 GMT
< Cache-Control: max-age=604800
Cache-Control: max-age=604800
< Accept-Ranges: bytes
Accept-Ranges: bytes

<
* Closing connection #0



[root@ns1234 ~]# curl -v -I --http1.0 --user-agent "google" http://www.domain.com/images/image.jpg
* About to connect() to www.domain.com port 80 (#0)
* Trying 123.123.123.12... connected
* Connected to www.domain.com (123.123.123.12) port 80 (#0)
> HEAD /images/image.jpg HTTP/1.0
> User-Agent: google
> Host: www.domain.com
> Accept: */*
>
< HTTP/1.1 200 OK
HTTP/1.1 200 OK
< Server: nginx/1.12.2
Server: nginx/1.12.2
< Date: Thu, 11 Oct 2018 15:07:16 GMT
Date: Thu, 11 Oct 2018 15:07:16 GMT
< Content-Type: image/jpeg
Content-Type: image/jpeg
< Content-Length: 458344
Content-Length: 458344
< Last-Modified: Wed, 12 Apr 2017 00:52:30 GMT
Last-Modified: Wed, 12 Apr 2017 00:52:30 GMT
< Connection: close
Connection: close
< ETag: "58ed7a4e-6fe68"
ETag: "58ed7a4e-6fe68"
< Expires: Thu, 18 Oct 2018 15:07:16 GMT
Expires: Thu, 18 Oct 2018 15:07:16 GMT
< Cache-Control: max-age=604800
Cache-Control: max-age=604800
< Accept-Ranges: bytes
Accept-Ranges: bytes

<
* Closing connection #0


---------- Добавлено 11.10.2018 в 18:14 ----------

coolwebsearcher:


какой конфиг nginx для этого виртуального хоста?

server {

server_name domain.com www.domain.com;
charset off;
index index.php index.html;
disable_symlinks if_not_owner from=$root_path;
include /etc/nginx/vhosts-includes/*.conf;
include /etc/nginx/vhosts-resources/domain.com/*.conf;
access_log /var/www/httpd-logs/domain.com.access.log;
error_log /var/www/httpd-logs/domain.com.error.log notice;
ssi on;
set $root_path /var/www/user/data/www/domain.com;
root $root_path;
listen 123.123.123.12:80;
listen [1234:12d0:2:1234::1]:80;
gzip on;
gzip_comp_level 4;
gzip_disable "msie6";
gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript application/javascript;
location /images/ {
set $button_redirect 0;
if ($http_referer ~ "\.google\.") { set $button_redirect 1; }
if ($button_redirect = 1) {
rewrite "^/images/([0-9]+)-(.*)\.(jpg|jpeg|png|gif)$" http://www.domain.com/$1-.html;
}
alias /home/images/;
expires 7d;
}
location / {
location ~ [^/]\.ph(p\d*|tml)$ {
try_files /does_not_exists @fallback;
}
location ~* ^.+\.(jpg|jpeg|gif|png|svg|js|css|mp3|ogg|mpe?g|avi|zip|gz|bz2?|rar|swf)$ {
expires 7d;
try_files $uri $uri/ @fallback;
}
location / {
try_files /does_not_exists @fallback;
}
}
location @fallback {
proxy_pass http://127.0.0.1:8080;
proxy_redirect http://127.0.0.1:8080 /;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-Port $server_port;
access_log off;
}
}
kimsufi.com ( https://www.kimsufi.com ) очень дешевые и качественные дедики https://clck.ru/gvF9p - антибот, использую уже 3 года.
coolwebsearcher
На сайте с 29.09.2008
Offline
87
#12

речь про логи nginx (/var/www/httpd-logs/domain.com.access.log в данном случае).


location /images/ {
set $button_redirect 0;
if ($http_referer ~ "\.google\.") { set $button_redirect 1; }
if ($button_redirect = 1) {
rewrite "^/images/([0-9]+)-(.*)\.(jpg|jpeg|png|gif)$" http://www.domain.com/$1-.html;
}

скорее всего этот кусок не так работает

https://www.nginx.com/resources/wiki/start/topics/depth/ifisevil/

Услуги (http://www.our-dns.info/) | Цены (http://www.our-dns.info/prices/) | Отзывы (/ru/forum/970789)
12

Авторизуйтесь или зарегистрируйтесь, чтобы оставить комментарий