Welcome! Log In Create A New Profile

Advanced

Re[3]: image_filter и хацкеры.

Михаил Монашёв
April 02, 2012 05:38AM
Здравствуйте.

Вот такой конфиг в итоге получился:

server {
listen 83.222.4.74:80;
server_name mysite.ru;
valid_referers none blocked mysite.ru *.mysite.ru ~\.google\. ;
if ($invalid_referer) {
return 403;
}

location ~* "^/((10|127|224)\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}|(192\.168|169\.254|0\.0)\.[0-9]{1,3}\.[0-9]{1,3}|172.(1[6-9]|2[0-9]|3[01])\.[0-9]{1,3}\.[0-9]{1,3}|localhost)/" {
return 403;
}

location ~* "^/([^/]+)/(.*)" {
proxy_pass http://$1:80/$2;
proxy_set_header Host $1;
proxy_set_header Referer "http://$1/";
proxy_set_header X-Real-IP "";
proxy_set_header Cookie "";
proxy_ignore_headers X-Accel-Redirect X-Accel-Expires X-Accel-Limit-Rate X-Accel-Buffering X-Accel-Charset Expires Cache-Control Set-Cookie;

proxy_hide_header Location;
proxy_hide_header Set-Cookie;
proxy_hide_header WWW-Authenticate;

proxy_intercept_errors on;
error_page 301 302 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 422 423 424 425 426 449 500 501 502 503 504 505 506 507 509 510 = /zero;

proxy_temp_path /cache/proxy-tmp;
proxy_cache cache;

image_filter test;
image_filter_buffer 10M;
}

location / {
return 403;
}

location /zero {
return 204;
}
}

Он получает запросы вида http://mysite.ru/s018.radikal.ru/i503/1201/40/64d1e692b053.jpg ,
скачивает картинку (даже если есть защита от хотлинкинга), проверяет
её, что она картинка, убирает куки, редиректы и авторизацию, кэширует
её и отдаёт юзеру, если запрос пришёл с нашего сайта или поиска по
картинкам гугла.

Скажите пожалуйста, что здесь ещё можно доработать?


--
С уважением,
Михаил mailto:postmaster@softsearch.ru

_______________________________________________
nginx-ru mailing list
nginx-ru@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-ru
Subject Author Posted

image_filter и хацкеры.

Михаил Монашёв March 31, 2012 05:44AM

Re: image_filter и хацкеры.

Spoofing March 31, 2012 06:12AM

Re: image_filter и хацкеры.

Gena Makhomed March 31, 2012 06:32AM

Re: image_filter и хацкеры.

Igor Sysoev March 31, 2012 07:04AM

Re[2]: image_filter и хацкеры.

Михаил Монашёв March 31, 2012 11:36AM

Re: image_filter и хацкеры.

Igor Sysoev March 31, 2012 12:42PM

Re: image_filter и хацкеры.

SaveFrom.net April 02, 2012 01:38AM

Re: image_filter и хацкеры.

Anton Yuzhaninov March 31, 2012 03:26PM

Re[2]: image_filter и хацкеры.

Михаил Монашёв March 31, 2012 04:34PM

Re[3]: image_filter и хацкеры.

Михаил Монашёв April 02, 2012 05:38AM

Re[4]: image_filter и хацкеры.

Михаил Монашёв April 02, 2012 06:10AM

Re[5]: image_filter и хацкеры.

Михаил Монашёв April 03, 2012 05:26AM

Re[5]: image_filter и хацкеры.

Oleksandr V. Typlyns'kyi April 03, 2012 06:36AM

Re[6]: image_filter и хацкеры.

Михаил Монашёв April 03, 2012 08:34AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 214
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready