iccup

iccup
Рейтинг
208
Регистрация
01.05.2016

это понятно что картинку не защитить, мне хотя бы от автопарсинга ботами оградиться.

Какую альтернативу предлагаете? у меня кстати бурж сайты.

iccup:
а можешь сделать такое для сервера, мне нужно чтоб картинки не парсили.

так хули не отвечаешь

а можешь сделать такое для сервера, мне нужно чтоб картинки не парсили.

т.е. падение трафика на следующий день после заливки файла отклонения ссылок это совпадение?

у меня есть сетка около 10 сайтов, они тупо на одном ip с продвигаемым, и ничего.

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;
}
}

я делал так, код 200. Сейчас зашел в панлеь управления сервером а там показывает загрузку swap 99%. Может ли это быть причиной проблемы? И как его разгрузить? Сейчас перебрасываю некоторые файлы на другой диск, не знаю поможет ли.

Загрузка SWAP была временной, вероятно это связано было с отключением апач для эксперимента.

coolwebsearcher:

curl -v -I --http1.0 --user-agent "google" https://site/картинка


если реф есть то его тоже указать, так если сделайте запрос как у бота гугла.
[root@ns000111 ~]# curl -v -I --http1.0 --user-agent "google" http://www.domain.com/picsup/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 /image/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 11:33:01 GMT
Date: Thu, 11 Oct 2018 11:33:01 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 11:33:01 GMT
Expires: Thu, 18 Oct 2018 11:33:01 GMT
< Cache-Control: max-age=604800
Cache-Control: max-age=604800
< Accept-Ranges: bytes
Accept-Ranges: bytes

Ip конечно же проверял, вот например строчка -

66.249.64.87 - - [11/Oct/2018:03:35:37 +0300] "GET /images/image.jpg HTTP/1.0" 404 308 "-" "Googlebot-Image/1.0"
Всего: 1370