Advertisement
hxxxrz

config vladimir

Nov 23rd, 2017
300
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ###############################################################################################
  2. #
  3. #                       15.10.2017 Config   for    Nginx >= 1.11.10 https://habrahabr.ru/post/282554/
  4. #                         Полный мануал настройки http://pastebin.com/v0VKjKXW
  5. #
  6. #                               v 1.3 fast server http://vk.cc/5VDdBb
  7. #                       Рабочий вариант, кеширование работает ( + кеширование в оперативную память )
  8. #===================support / вопросы, пожелания, замечания просьба слать сюда 2010-10 @ mail.ru ==============
  9. #                              
  10. #
  11. # Nginx port 80 -> Apache 81
  12. # -  !ВАЖНО! прописать свой ip в секцию Upstream B      <<<<<-!!!
  13. # - Динамическое определение доменов(поддоменов) и их директорий, и алиасов. (Настроено под VestaCP, если не угодно - поменяйте)
  14. # - Максимальная производительность и оптимизация
  15. # - Защита картинок и файлов отдайющихся nginx от хотлинкинга
  16. # - Защита от сторонних ботов, для снижения нагрузки
  17. # - SSl убран на apache2 , если надо сами настраивайте )
  18. #
  19. #Дополнительно: помещаем кэш nginx в ramdisk (tmpfs)
  20. #Сейчас у нас кэширование настроено, но кэш хранится на жестком диске, что не является хорошим решение. Оптимальнее будет смонтировать директорию с кэшем nginx в память.
  21. #Для этого откроем
  22. #nano/etc/fstab
  23. #и добавим туда:
  24. #tmpfs /var/lib/nginx/cache tmpfs nodev,nosuid,size=20M 0 0
  25. #Если в настройках nginx вы указали больший размер кэша, то параметр size необходимо изменить в соответствии с указанным размером кэша #(max_size), плюс небольшой запас.
  26. #Сразу смонтируем директорию в память:
  27. #sudo mount -a
  28. #service nginx restart; service apache2 restart; reboot;
  29. #Теперь при каждой загрузке системы, директория /var/lib/nginx/cache будет помещаться в память, что должно уменьшить время отдачи #страницы.
  30. #
  31. #  Test VPS !KVM  1x1024RAM 20Gb SSD
  32. ## ab -r -n 10000 -c 10000 http://site.com/
  33. #Concurrency Level:      10000
  34. #Time taken for tests:   0.835 seconds
  35. #Complete requests:      10000
  36. #Failed requests:        0
  37. #Non-2xx responses:      10000
  38. #Total transferred:      3200000 bytes
  39. #HTML transferred:       1620000 bytes
  40. #Requests per second:    11976.08 [#/sec] (mean)
  41. #Time per request:       834.998 [ms] (mean)
  42. #Time per request:       0.083 [ms] (mean, across all concurrent requests)
  43. #Transfer rate:          3742.52 [Kbytes/sec] received
  44. #
  45. #Connection Times (ms)
  46. #              min  mean[+/-sd] median   max
  47. #Total:        530  644  66.0    646     758
  48. ################################################################################################
  49.  
  50.  
  51. # Server globals
  52. user root; # так же как в apache2
  53.  
  54. worker_processes    auto;
  55. worker_cpu_affinity auto;
  56.  
  57. timer_resolution 100ms;     #Уменьшает разрешение таймеров времени в рабочих процессах, за счёт чего уменьшается число системных вызовов
  58. worker_rlimit_nofile 65192; #Изменяет ограничение на максимальное число открытых файлов (RLIMIT_NOFILE) для рабочих процессов
  59. worker_priority -5;         #Выставляем более высокий приоритет процессу воркера
  60.  
  61. error_log               /var/log/nginx/error.log;
  62. pid                     /var/run/nginx.pid;
  63.  
  64. # Worker config
  65. events {
  66.         worker_connections 20048;    # Максимальное количество подключений на процесс
  67.        use                epoll;
  68.        
  69.         accept_mutex off;
  70.       }
  71.  
  72. http {
  73.    
  74.     # Mime settings
  75.    include             /etc/nginx/mime.types;
  76.     default_type        application/octet-stream;
  77.    
  78.        # Main settings
  79.      
  80.         # не нужно включать sendfile, если не работаете с ram диском! Во-первых, вы теряете кэширование, что очень актуально для мелких файлов.
  81.        #Во-вторых, для эффективной работы с дисками (hdd и ssd) есть aio/directio, которые не работают вместе с sendfile.
  82.        sendfile       off;
  83.         sendfile_max_chunk 512k;
  84.         tcp_nopush     on;
  85.         tcp_nodelay    on;
  86.            
  87.         # Таймаут при чтении тела запроса клиента
  88.        client_body_timeout   5;
  89.         # Таймаут при чтении заголовка запроса клиента
  90.        client_header_timeout 5;
  91.         #Таймаут соединения позволяют избежать необходимости повторного создания соединения между клиентом и сервером.
  92.        keepalive_timeout  3 5;
  93.         # Максимальное количество keepalive запросов от одного клиента
  94.         keepalive_requests 100;
  95.         # Если клиент прекратит чтение ответа, Nginx подождет 1 секунду и сбросит соединение
  96.        send_timeout 1;
  97.  
  98.     # Максимальный размер буфера для хранения тела запроса клиента
  99.    client_body_buffer_size 10K;
  100.     # Максимальный размер буфера для хранения заголовков запроса клиента
  101.    client_header_buffer_size 5k;
  102.     # Максимальный размер тела запроса клиента, прописанный в поле Content-Length заголовка.
  103.     # Если сервер должен поддерживать загрузку         файлов, это значение необходимо увеличить
  104.    client_max_body_size 8m;
  105.     # Количество и размер буферов для чтения большого заголовка запроса клиента
  106.    large_client_header_buffers 2 5k;
  107.     reset_timedout_connection on;
  108.        
  109.     server_tokens                   off;
  110.     server_name_in_redirect         off;
  111.     server_names_hash_max_size      512;
  112.     server_names_hash_bucket_size   512;
  113.            
  114.     # Proxy settings
  115.    proxy_redirect         off;
  116.     proxy_connect_timeout   300;
  117.     proxy_send_timeout      300;
  118.     proxy_read_timeout      300;
  119.     proxy_buffering on;
  120.     proxy_buffers 8 2m;
  121.     proxy_buffer_size 10m;
  122.     proxy_busy_buffers_size 10m;
  123.        
  124.              # Cache https://syrog.ru/?p=314
  125.              proxy_cache_path /var/lib/nginx/cache levels=1:2 keys_zone=cache:10m inactive=10m max_size=15m; #inactive Время хранения данных с последнего обращения
  126.              proxy_temp_path /var/lib/nginx/proxy 1 2;
  127.              proxy_cache_key "$request_method|$http_if_modified_since|$http_if_none_match|$host|$request_uri";
  128.              proxy_hide_header "Set-Cookie"; # Гарантируем, что разные пользователи не получат одну и ту же сессионную Cookie.
  129.             proxy_ignore_headers Expires Cache-Control;
  130.              proxy_cache_use_stale error timeout http_500 http_502 http_503 http_504;
  131.              proxy_cache_bypass $cookie_session;
  132.              proxy_no_cache $cookie_session;
  133.              proxy_cache_valid 200 301 302 304 60m; #Время хранения данных в кеше 60 мин
  134.              proxy_cache_valid 404 1m;
  135.              
  136.       # Настройки GZIP
  137.        # http://nginx.org/ru/docs/http/ngx_http_gzip_module.html
  138.        gzip               on;
  139.         gzip_static        on;
  140.         gzip_min_length  1024;
  141.         gzip_buffers    64 8k;
  142.         gzip_http_version 1.1;
  143.         # Разрешает или запрещает сжатие ответа методом gzip для проксированных запросов в зависимости от запроса и ответа.
  144.        gzip_proxied     expired no-cache no-store private auth;
  145.         # Разрешает сжатие ответа методом gzip для указанных MIME-типов в дополнение к text/html, который сжимается всегда.
  146.        gzip_types          text/plain text/css application/x-javascript application/json application/javascript text/xml application/xml application/xml+rss text/javascript image/svg+xml application/x-font-ttf font/opentype;
  147.         # Запрещаем сжатие gzip для IE6. Специальная маска “msie6” (0.7.12) соответствует рег. выражению “MSIE [4-6]\.”, но работает быстрее. Начиная с версии 0.8.11, из этой маски исключается “MSIE 6.0; ... SV1”.
  148.        gzip_disable     "msie6";
  149.         # Уровень gzip-компрессии.
  150.        gzip_comp_level    7;
  151.         gzip_proxied     any;
  152.  
  153. upstream A {
  154.     server 127.0.0.1:81;
  155.            }
  156.            # Указать свой ip:81;
  157. upstream B {
  158.     server Указать свой ip:81;
  159.     }
  160.        
  161.     server {   
  162.             if ($request_method !~ ^(GET|HEAD|POST)$ ) {
  163.             return 444;
  164.             }
  165.        
  166.         #выставляем принудительно кодировку всех документов
  167.        charset utf-8;
  168.        
  169.         listen 80 reuseport; # Слушаем 80 порт
  170.        
  171.         #Редирект с www на без www
  172.         if ($http_host ~* "^www\.(.+)\.(.+)$"){  #Запоминаем хост без www из предыдущего выражения в переменной $nowww
  173.        set $nowww $1.$2;
  174.         #Делаем 301 редирект (permanent) .В $request_uri - адрес без хоста со всеми GET параметрами. После $request_uri добавляем '?' чтобы GET параметры  не добавились дважды (по умолчанию)
  175.        rewrite ^ http://$nowww$request_uri? permanent;  }
  176.        
  177.         #Динамическое определение доменов и поддоменов
  178.         #!Путь до папки с сайтом как в Vesta СP /home/admin/web/domen.ru/public_html/
  179.         #Если нужные другие пути, они редактируются в строка помеченных #1
  180.        set $basepath "/home/admin/web"; #1
  181.        set $domain $host;
  182.  
  183.         if ($domain ~ "^(.[^.]*)$") {
  184.                 set $domain $1;
  185.                 set $rootpath "${domain}/public_html/"; #1
  186.                 set $servername "${domain}";
  187.         }
  188.         if ($domain ~ "^(.*)\.(.[^.]*)$") {
  189.                 set $subdomain $1;
  190.                 set $domain $2;
  191.                 set $rootpath "${subdomain}.${domain}/public_html/"; #1
  192.                 set $servername "${subdomain}.${domain}";
  193.         }
  194.         #Отключена ошибка 404 при отсутствии директории для  работы алисов доменов и адресов вида ip
  195.        #if (!-d $basepath/$rootpath) { return 404;  }
  196.        
  197.         server_name $servername;
  198.         #
  199.        
  200.         index index.php index.html index.htm;
  201.                
  202.         location / {
  203.             # Все POST запросы отправляем на бекенд
  204.             if ($request_method = POST) {
  205.             proxy_pass http://A; break;
  206.             }  
  207.          
  208.              proxy_cache cache;
  209.  
  210.             location ~* ^.+\.(bmp|jpg|jpeg|gif|png|svg|js|css|html|htm|ico|txt|pdf|pptx?|docx?|xlsx?|rtf|xpi|mp3|ogg|mpe?g|avi|zip|gz|bz2?|rar|swf)$ {
  211.                            expires 7d;
  212.                            root $basepath/$rootpath/; # Директория поиска файлов
  213.                            #Защита от хотлинкинга , указанных поисковых сайтов и соцсетей  
  214.                            #Хитрая проверка на свой сайт, ввиду того что динамика и сайты у нас разные
  215.                            #Спасибо автору Maxim Dounin http://nginx.org/en/donation.html
  216.                            set $temp "$host:$http_referer";
  217.                            if ($temp ~* "^(.*):https?://\1") {
  218.                             set $invalid_referer "0";
  219.                             }
  220.                              #Разрешено поисковым сайтам и соцсетям отображать у себя картинки и прочие файлы
  221.                              valid_referers none blocked server_names ~(duckduckgo|yandex|google|yahoo|bing|ok|twitter|vk|facebook|subscribe|feedburner|mail|rambler|nigma|ask|qip);
  222.                              if ($invalid_referer) {
  223.                              return 403;
  224.                              #сюда можно засунуть вместо retunr 403 свою картинку
  225.                              #rewrite ^(.*)$ http://blogsisadmina.ru/wp-content/uploads/2015/11/26.jpg redirect;
  226.                              
  227.                              }
  228.                           #
  229.                           error_page 404 502 503 504 = @fallback;
  230.                           try_files $uri @fallback;
  231.                           log_not_found  off;
  232.                 }
  233.  
  234.                 proxy_pass http://A;
  235.                 proxy_redirect  http://A/ /;
  236.                 proxy_set_header    Host            $host;
  237.                 proxy_set_header    X-Real-IP       $remote_addr;
  238.                 proxy_set_header    X-Forwarded-For $proxy_add_x_forwarded_for;
  239.                
  240.                 #Повторный запрос при ошибке
  241.                 error_page 404 502 503 504 = @fallback;
  242.                 try_files $uri @fallback;
  243.                
  244.                 aio threads;
  245.                 log_not_found  off;
  246.         }
  247.         location @fallback {
  248.                 proxy_pass  http://B;  
  249.                 proxy_set_header    Host            $host;
  250.                 proxy_set_header    X-Real-IP       $remote_addr;
  251.                 proxy_set_header    X-Forwarded-For $proxy_add_x_forwarded_for;
  252.                 log_not_found  off;
  253.         }
  254.         # Блокируем менеджеры загрузки и некоторые типы ботов (update 15.10.2017)
  255.         if ($http_user_agent ~ "8484\ Boston\ Project"){    return 403;  }  if ($http_user_agent ~ "Accelerator"){    return 403;  }  if ($http_user_agent ~ "AESOP"){    return 403;  }  if ($http_user_agent ~ "Ahrefs"){    return 403;  }  if ($http_user_agent ~ "AhrefsBot"){    return 403;  }  if ($http_user_agent ~ "Alexibot"){    return 403;  }  if ($http_user_agent ~ "almaden"){    return 403;  }  if ($http_user_agent ~ "Anarchie"){    return 403;  }  if ($http_user_agent ~ "Anonymouse.org"){    return 403;  }  if ($http_user_agent ~ "Ants"){    return 403;  }  if ($http_user_agent ~ "ApacheBench"){    return 403;  }  if ($http_user_agent ~ "Aport"){    return 403;  }  if ($http_user_agent ~ "AppEngine"){    return 403;  }  if ($http_user_agent ~ "Applebot"){    return 403;  }  if ($http_user_agent ~ "Aqua_Products"){    return 403;  }  if ($http_user_agent ~ "archive"){    return 403;  }  if ($http_user_agent ~ "Ask\ Jeeves"){    return 403;  }  if ($http_user_agent ~ "ASPSeek"){    return 403;  }  if ($http_user_agent ~ "asterias"){    return 403;  }  if ($http_user_agent ~ "Atomic_Email_Hunter"){    return 403;  }  if ($http_user_agent ~ "atSpider"){    return 403;  }  if ($http_user_agent ~ "attach"){    return 403;  }  if ($http_user_agent ~ "autoemailspider"){    return 403;  }  if ($http_user_agent ~ "b2w"){    return 403;  }  if ($http_user_agent ~ "BackDoorBot"){    return 403;  }  if ($http_user_agent ~ "BackWeb"){    return 403;  }  if ($http_user_agent ~ "BaiduBot"){    return 403;  }  if ($http_user_agent ~ "Baiduspider"){    return 403;  }  if ($http_user_agent ~ "bandit"){    return 403;  }  if ($http_user_agent ~ "Bandit"){    return 403;  }  if ($http_user_agent ~ "BatchFTP"){    return 403;  }  if ($http_user_agent ~ "Bigfoot"){    return 403;  }  if ($http_user_agent ~ "Birubot"){    return 403;  }  if ($http_user_agent ~ "Black\ Hole"){    return 403;  }  if ($http_user_agent ~ "BlackWidow"){    return 403;  }  if ($http_user_agent ~ "BLEXBot"){    return 403;  }
  256.         if ($http_user_agent ~ "BlowFish"){    return 403;  }  if ($http_user_agent ~ "Bookmark\ search\ tool"){    return 403;  }  if ($http_user_agent ~ "BotALot"){    return 403;  }  if ($http_user_agent ~ "bsalsa"){    return 403;  }  if ($http_user_agent ~ "Buddy"){    return 403;  }  if ($http_user_agent ~ "BuiltBotTough"){    return 403;  }  if ($http_user_agent ~ "BullsEye"){    return 403;  }  if ($http_user_agent ~ "bumblebee"){    return 403;  }  if ($http_user_agent ~ "BunnySlippers"){    return 403;  }  if ($http_user_agent ~ "Butterfly"){    return 403;  }  if ($http_user_agent ~ "Buzzbot"){    return 403;  }  if ($http_user_agent ~ "BuzzSumo"){    return 403;  }  if ($http_user_agent ~ "bwh3_user_agent"){    return 403;  }  if ($http_user_agent ~ "CamontSpider"){    return 403;  }  if ($http_user_agent ~ "CCBot"){    return 403;  }  if ($http_user_agent ~ "Cegbfeieh"){    return 403;  }  if ($http_user_agent ~ "CheeseBot"){    return 403;  }  if ($http_user_agent ~ "CherryPicker"){    return 403;  }  if ($http_user_agent ~ "China"){    return 403;  }  if ($http_user_agent ~ "ChinaClaw"){    return 403;  }  if ($http_user_agent ~ "CICC"){    return 403;  }  if ($http_user_agent ~ "clsHTTP"){    return 403;  }  if ($http_user_agent ~ "coccoc"){    return 403;  }  if ($http_user_agent ~ "Collector"){    return 403;  }  if ($http_user_agent ~ "CommentReader"){    return 403;  }  if ($http_user_agent ~ "ContactBot"){    return 403;  }  if ($http_user_agent ~ "ContentSmartz"){    return 403;  }  if ($http_user_agent ~ "Copernic"){    return 403;  }  if ($http_user_agent ~ "Copier"){    return 403;  }  if ($http_user_agent ~ "CopyRightCheck"){    return 403;  }  if ($http_user_agent ~ "cosmos"){    return 403;  }  if ($http_user_agent ~ "crazy"){    return 403;  }  if ($http_user_agent ~ "Crescent"){    return 403;  }  if ($http_user_agent ~ "curl"){    return 403;  }  if ($http_user_agent ~ "Curl"){    return 403;  }  if ($http_user_agent ~ "Custo"){    return 403;  }  if ($http_user_agent ~ "DataCha0s"){    return 403;  }
  257.         if ($http_user_agent ~ "dataminr"){    return 403;  }  if ($http_user_agent ~ "DBrowse"){    return 403;  }  if ($http_user_agent ~ "Demo\ Bot"){    return 403;  }  if ($http_user_agent ~ "DeuSu"){    return 403;  }  if ($http_user_agent ~ "Digincore"){    return 403;  }  if ($http_user_agent ~ "DIIbot"){    return 403;  }  if ($http_user_agent ~ "DISCo"){    return 403;  }  if ($http_user_agent ~ "discobot"){    return 403;  }  if ($http_user_agent ~ "Dispatch"){    return 403;  }  if ($http_user_agent ~ "dit"){    return 403;  }  if ($http_user_agent ~ "DittoSpyder"){    return 403;  }  if ($http_user_agent ~ "Dolphin"){    return 403;  }  if ($http_user_agent ~ "DomainSigma"){    return 403;  }  if ($http_user_agent ~ "DomainTools"){    return 403;  }  if ($http_user_agent ~ "DotBot"){    return 403;  }  if ($http_user_agent ~ "Download\ Demon"){    return 403;  }  if ($http_user_agent ~ "Download\ Devil"){    return 403;  }  if ($http_user_agent ~ "Download\ Wonder"){    return 403;  }  if ($http_user_agent ~ "Downloader"){    return 403;  }  if ($http_user_agent ~ "dragonfly"){    return 403;  }  if ($http_user_agent ~ "Drip"){    return 403;  }  if ($http_user_agent ~ "DSurf15"){    return 403;  }  if ($http_user_agent ~ "DuckDuckGo"){    return 403;  }  if ($http_user_agent ~ "EasyDL"){    return 403;  }  if ($http_user_agent ~ "ebingbong"){    return 403;  }  if ($http_user_agent ~ "EBrowse"){    return 403;  }  if ($http_user_agent ~ "eCatch"){    return 403;  }  if ($http_user_agent ~ "Educate\ Search\ VxB"){    return 403;  }  if ($http_user_agent ~ "EirGrabber"){    return 403;  }  if ($http_user_agent ~ "email"){    return 403;  }  if ($http_user_agent ~ "EmailCollector"){    return 403;  }  if ($http_user_agent ~ "EmailSiphon"){    return 403;  }  if ($http_user_agent ~ "EmailSpider"){    return 403;  }  if ($http_user_agent ~ "EmailWolf"){    return 403;  }  if ($http_user_agent ~ "Embedly"){    return 403;  }  if ($http_user_agent ~ "EroCrawler"){    return 403;  }  if ($http_user_agent ~ "ESurf15"){    return 403;  }
  258.         if ($http_user_agent ~ "Exabot"){    return 403;  }  if ($http_user_agent ~ "Express\ WebPictures"){    return 403;  }  if ($http_user_agent ~ "Extractor"){    return 403;  }  if ($http_user_agent ~ "EyeNetIE"){    return 403;  }  if ($http_user_agent ~ "Ezooms"){    return 403;  }  if ($http_user_agent ~ "facebookexternalhit"){    return 403;  }  if ($http_user_agent ~ "FairAd\ Client"){    return 403;  }  if ($http_user_agent ~ "FairShare"){    return 403;  }  if ($http_user_agent ~ "Faraday"){    return 403;  }  if ($http_user_agent ~ "Favicon"){    return 403;  }  if ($http_user_agent ~ "FeedFetcher"){    return 403;  }  if ($http_user_agent ~ "FileHound"){    return 403;  }  if ($http_user_agent ~ "filterdb"){    return 403;  }  if ($http_user_agent ~ "Flaming\ AttackBot"){    return 403;  }  if ($http_user_agent ~ "FlashGet"){    return 403;  }  if ($http_user_agent ~ "FlaxCrawler"){    return 403;  }  if ($http_user_agent ~ "Flexum"){    return 403;  }  if ($http_user_agent ~ "FlightDeckReportsBot"){    return 403;  }  if ($http_user_agent ~ "FlipboardProxy"){    return 403;  }  if ($http_user_agent ~ "flunky"){    return 403;  }  if ($http_user_agent ~ "Foobot"){    return 403;  }  if ($http_user_agent ~ "Franklin\ Locator"){    return 403;  }  if ($http_user_agent ~ "FrontPage"){    return 403;  }  if ($http_user_agent ~ "FSurf15"){    return 403;  }  if ($http_user_agent ~ "Full\ Web\ Bot"){    return 403;  }  if ($http_user_agent ~ "FyberSpider"){    return 403;  }  if ($http_user_agent ~ "Gaisbot"){    return 403;  }  if ($http_user_agent ~ "getintent"){    return 403;  }  if ($http_user_agent ~ "getprismatic"){    return 403;  }  if ($http_user_agent ~ "GetRight"){    return 403;  }  if ($http_user_agent ~ "Gets"){    return 403;  }  if ($http_user_agent ~ "GetSmart"){    return 403;  }  if ($http_user_agent ~ "GetWeb!"){    return 403;  }  if ($http_user_agent ~ "gigabaz"){    return 403;  }  if ($http_user_agent ~ "Gigabot"){    return 403;  }  if ($http_user_agent ~ "Go 1.1 package"){    return 403;  }
  259.         if ($http_user_agent ~ "Go!Zilla"){    return 403;  }  if ($http_user_agent ~ "Go-Ahead-Got-It"){    return 403;  }  if ($http_user_agent ~ "Go-http-client"){    return 403;  }  if ($http_user_agent ~ "gold crawler"){    return 403;  }  if ($http_user_agent ~ "gold\ crawler"){    return 403;  }  if ($http_user_agent ~ "gotit"){    return 403;  }  if ($http_user_agent ~ "GoZilla"){    return 403;  }  if ($http_user_agent ~ "Grabber"){    return 403;  }  if ($http_user_agent ~ "GrabNet"){    return 403;  }  if ($http_user_agent ~ "GrabSite"){    return 403;  }  if ($http_user_agent ~ "Grafula"){    return 403;  }  if ($http_user_agent ~ "GrapeshotCrawler"){    return 403;  }  if ($http_user_agent ~ "grub"){    return 403;  }  if ($http_user_agent ~ "grub-client"){    return 403;  }  if ($http_user_agent ~ "gsa-crawler"){    return 403;  }  if ($http_user_agent ~ "Guestbook\ Auto\ Submitter"){    return 403;  }  if ($http_user_agent ~ "Gulliver"){    return 403;  }  if ($http_user_agent ~ "Harvest"){    return 403;  }  if ($http_user_agent ~ "help.jp"){    return 403;  }  if ($http_user_agent ~ "hloader"){    return 403;  }  if ($http_user_agent ~ "HMView"){    return 403;  }  if ($http_user_agent ~ "HTMLParser"){    return 403;  }  if ($http_user_agent ~ "httpdown"){    return 403;  }  if ($http_user_agent ~ "httplib"){    return 403;  }  if ($http_user_agent ~ "httrack"){    return 403;  }  if ($http_user_agent ~ "HTTrack"){    return 403;  }  if ($http_user_agent ~ "humanlinks"){    return 403;  }  if ($http_user_agent ~ "hybrid"){    return 403;  }  if ($http_user_agent ~ "ia_archiver"){    return 403;  }  if ($http_user_agent ~ "IBrowse"){    return 403;  }  if ($http_user_agent ~ "IlseBot"){    return 403;  }  if ($http_user_agent ~ "Image\ Stripper"){    return 403;  }  if ($http_user_agent ~ "Image\ Sucker"){    return 403;  }  if ($http_user_agent ~ "Industry\ Program"){    return 403;  }  if ($http_user_agent ~ "Indy Library"){    return 403;  }  if ($http_user_agent ~ "Indy\ Library"){    return 403;  }
  260.         if ($http_user_agent ~ "InfoNaviRobot"){    return 403;  }  if ($http_user_agent ~ "InfoSeek"){    return 403;  }  if ($http_user_agent ~ "InfoTekies"){    return 403;  }  if ($http_user_agent ~ "inktomi"){    return 403;  }  if ($http_user_agent ~ "Intelliseek"){    return 403;  }  if ($http_user_agent ~ "InterGET"){    return 403;  }  if ($http_user_agent ~ "Internet\ Ninja"){    return 403;  }  if ($http_user_agent ~ "InternetLinkagent"){    return 403;  }  if ($http_user_agent ~ "InternetSeer"){    return 403;  }  if ($http_user_agent ~ "Iria"){    return 403;  }  if ($http_user_agent ~ "Iron33"){    return 403;  }  if ($http_user_agent ~ "ISC\ Systems"){    return 403;  }  if ($http_user_agent ~ "IUPUI\ Research\ Bot"){    return 403;  }  if ($http_user_agent ~ "Jakarta"){    return 403;  }  if ($http_user_agent ~ "Java"){    return 403;  }  if ($http_user_agent ~ "JBH\ agent"){    return 403;  }  if ($http_user_agent ~ "JennyBot"){    return 403;  }  if ($http_user_agent ~ "jetcar"){    return 403;  }  if ($http_user_agent ~ "JetCar"){    return 403;  }  if ($http_user_agent ~ "JOC"){    return 403;  }  if ($http_user_agent ~ "JS-Kit"){    return 403;  }  if ($http_user_agent ~ "JustView"){    return 403;  }  if ($http_user_agent ~ "Jyxobot"){    return 403;  }  if ($http_user_agent ~ "Kenjin\ Spider"){    return 403;  }  if ($http_user_agent ~ "Keyword\ Density"){    return 403;  }  if ($http_user_agent ~ "km.ru"){    return 403;  }  if ($http_user_agent ~ "kmSearchBot"){    return 403;  }  if ($http_user_agent ~ "Kraken"){    return 403;  }  if ($http_user_agent ~ "larbin"){    return 403;  }  if ($http_user_agent ~ "Laserlikebot"){    return 403;  }  if ($http_user_agent ~ "leech"){    return 403;  }  if ($http_user_agent ~ "LeechFTP"){    return 403;  }  if ($http_user_agent ~ "Leikibot"){    return 403;  }  if ($http_user_agent ~ "LetsCrawl.com"){    return 403;  }  if ($http_user_agent ~ "LexiBot"){    return 403;  }  if ($http_user_agent ~ "lftp"){    return 403;  }  if ($http_user_agent ~ "libWeb"){    return 403;  }  
  261.         if ($http_user_agent ~ "libwww"){    return 403;  }  if ($http_user_agent ~ "Lightspeedsystems"){    return 403;  }  if ($http_user_agent ~ "likse"){    return 403;  }  if ($http_user_agent ~ "Lincoln\ State\ Web\ Browser"){    return 403;  }  if ($http_user_agent ~ "Linguee"){    return 403;  }  if ($http_user_agent ~ "LinkBot"){    return 403;  }  if ($http_user_agent ~ "linkdexbot"){    return 403;  }  if ($http_user_agent ~ "LinkExchanger"){    return 403;  }  if ($http_user_agent ~ "LinkextractorPro"){    return 403;  }  if ($http_user_agent ~ "linkfluence"){    return 403;  }  if ($http_user_agent ~ "LinkpadBot"){    return 403;  }  if ($http_user_agent ~ "LinkScan"){    return 403;  }  if ($http_user_agent ~ "LinkSleuth"){    return 403;  }  if ($http_user_agent ~ "LinkWalker"){    return 403;  }  if ($http_user_agent ~ "liveinternet"){    return 403;  }  if ($http_user_agent ~ "LivelapBot"){    return 403;  }  if ($http_user_agent ~ "LMQueueBot"){    return 403;  }  if ($http_user_agent ~ "LNSpiderguy"){    return 403;  }  if ($http_user_agent ~ "LoadImpactPageAnalyzer"){    return 403;  }  if ($http_user_agent ~ "looksmart"){    return 403;  }  if ($http_user_agent ~ "ltx71"){    return 403;  }  if ($http_user_agent ~ "LWP"){    return 403;  }  if ($http_user_agent ~ "lwp-trivial"){    return 403;  }  if ($http_user_agent ~ "Mac\ Finder"){    return 403;  }  if ($http_user_agent ~ "Magnet"){    return 403;  }  if ($http_user_agent ~ "Mag-Net"){    return 403;  }  if ($http_user_agent ~ "majestic"){    return 403;  }  if ($http_user_agent ~ "MarkWatch"){    return 403;  }
  262.         if ($http_user_agent ~ "Mass\ Downloader"){    return 403;  }  if ($http_user_agent ~ "masscan"){    return 403;  }  if ($http_user_agent ~ "Mata\ Hari"){    return 403;  }  if ($http_user_agent ~ "meanpathbot"){    return 403;  }  if ($http_user_agent ~ "Mediatoolkitbot"){    return 403;  }  if ($http_user_agent ~ "MegaIndex"){    return 403;  }  if ($http_user_agent ~ "Memo"){    return 403;  }  if ($http_user_agent ~ "MetaURI"){    return 403;  }  if ($http_user_agent ~ "MFC\ Foundation\ Class\ Library"){    return 403;  }  if ($http_user_agent ~ "mfibot"){    return 403;  }  if ($http_user_agent ~ "Microsoft\ URL\ Control"){    return 403;  }  if ($http_user_agent ~ "MIDown\ tool"){    return 403;  }  if ($http_user_agent ~ "MIIxpc"){    return 403;  }  if ($http_user_agent ~ "Mirror"){    return 403;  }  if ($http_user_agent ~ "Missauga\ Loca"){    return 403;  }  if ($http_user_agent ~ "Missouri\ College\ Browse"){    return 403;  }  if ($http_user_agent ~ "Mister\ PiX"){    return 403;  }  if ($http_user_agent ~ "Mizzu\ Labs"){    return 403;  }  if ($http_user_agent ~ "MJ12bot"){    return 403;  }  if ($http_user_agent ~ "MLBot"){    return 403;  }  if ($http_user_agent ~ "Mo\ College"){    return 403;  }  if ($http_user_agent ~ "moget"){    return 403;  }  if ($http_user_agent ~ "Mozilla\ Indy"){    return 403;  }  if ($http_user_agent ~ "Mozilla\ MSIECrawler"){    return 403;  }  if ($http_user_agent ~ "Mozilla\ NEWT"){    return 403;  }  if ($http_user_agent ~ "MS\ FrontPage"){    return 403;  }  if ($http_user_agent ~ "MSFrontPage"){    return 403;  }  if ($http_user_agent ~ "MSIECrawler"){    return 403;  }  if ($http_user_agent ~ "MSProxy"){    return 403;  }  if ($http_user_agent ~ "musobot"){    return 403;  }  if ($http_user_agent ~ "MVAClient"){    return 403;  }  if ($http_user_agent ~ "NameOfAgent"){    return 403;  }  if ($http_user_agent ~ "NAMEPROTECT"){    return 403;  }  if ($http_user_agent ~ "NASA\ Search"){    return 403;  }  if ($http_user_agent ~ "Navroad"){    return 403;  }
  263.         if ($http_user_agent ~ "NearSite"){    return 403;  }  if ($http_user_agent ~ "NerdByNature"){    return 403;  }  if ($http_user_agent ~ "Net\ Vampire"){    return 403;  }  if ($http_user_agent ~ "NetAnts"){    return 403;  }  if ($http_user_agent ~ "Netcraft"){    return 403;  }  if ($http_user_agent ~ "NetMechanic"){    return 403;  }  if ($http_user_agent ~ "NetReaper"){    return 403;  }  if ($http_user_agent ~ "NetSeer"){    return 403;  }  if ($http_user_agent ~ "NetSpider"){    return 403;  }  if ($http_user_agent ~ "NetZIP"){    return 403;  }  if ($http_user_agent ~ "NewShareCounts"){    return 403;  }  if ($http_user_agent ~ "NextGenSearchBot"){    return 403;  }  if ($http_user_agent ~ "NICErsPRO"){    return 403;  }  if ($http_user_agent ~ "NimbleCrawler"){    return 403;  }  if ($http_user_agent ~ "NING"){    return 403;  }  if ($http_user_agent ~ "Ninja"){    return 403;  }  if ($http_user_agent ~ "NjuiceBot"){    return 403;  }  if ($http_user_agent ~ "NPbot"){    return 403;  }  if ($http_user_agent ~ "Nsauditor"){    return 403;  }  if ($http_user_agent ~ "Nutch"){    return 403;  }  if ($http_user_agent ~ "Nuzzel"){    return 403;  }  if ($http_user_agent ~ "Octopus"){    return 403;  }  if ($http_user_agent ~ "Offline"){    return 403;  }  if ($http_user_agent ~ "Offline\ Explorer"){    return 403;  }  if ($http_user_agent ~ "Offline\ Navigator"){    return 403;  }  if ($http_user_agent ~ "omgili"){    return 403;  }  if ($http_user_agent ~ "omgilibot"){    return 403;  }  if ($http_user_agent ~ "OmniExplorer_Bot"){    return 403;  }  if ($http_user_agent ~ "Openbot"){    return 403;  }  if ($http_user_agent ~ "Openfind"){    return 403;  }  if ($http_user_agent ~ "OpenHoseBot"){    return 403;  }  if ($http_user_agent ~ "openstat"){    return 403;  }  if ($http_user_agent ~ "openstat.ru"){    return 403;  }  if ($http_user_agent ~ "OptimizationCrawler"){    return 403;  }  if ($http_user_agent ~ "Oracle\ Ultra\ Search"){    return 403;  }  if ($http_user_agent ~ "OutfoxBot"){    return 403;  }
  264.         if ($http_user_agent ~ "PageGrabber"){    return 403;  }  if ($http_user_agent ~ "PageSaver"){    return 403;  }  if ($http_user_agent ~ "Panopta"){    return 403;  }  if ($http_user_agent ~ "Papa\ Foto"){    return 403;  }  if ($http_user_agent ~ "PaperLiBot"){    return 403;  }  if ($http_user_agent ~ "pavuk"){    return 403;  }  if ($http_user_agent ~ "PBrowse"){    return 403;  }  if ($http_user_agent ~ "pcBrowser"){    return 403;  }  if ($http_user_agent ~ "PerMan"){    return 403;  }  if ($http_user_agent ~ "PEval"){    return 403;  }  if ($http_user_agent ~ "pflab"){    return 403;  }  if ($http_user_agent ~ "PHP"){    return 403;  }  if ($http_user_agent ~ "PHP/"){    return 403;  }  if ($http_user_agent ~ "Ping"){    return 403;  }  if ($http_user_agent ~ "PingALink"){    return 403;  }  if ($http_user_agent ~ "Pingdom"){    return 403;  }  if ($http_user_agent ~ "pirst"){    return 403;  }  if ($http_user_agent ~ "Pita"){    return 403;  }  if ($http_user_agent ~ "Pockey"){    return 403;  }  if ($http_user_agent ~ "Poirot"){    return 403;  }  if ($http_user_agent ~ "Port\ Huron\ Labs"){    return 403;  }  if ($http_user_agent ~ "postano"){    return 403;  }  if ($http_user_agent ~ "PostRank"){    return 403;  }  if ($http_user_agent ~ "PrivacyAware"){    return 403;  }  if ($http_user_agent ~ "Production\ Bot"){    return 403;  }  if ($http_user_agent ~ "Program\ Shareware"){    return 403;  }  if ($http_user_agent ~ "ProPowerBot"){    return 403;  }  if ($http_user_agent ~ "ProWebWalker"){    return 403;  }  if ($http_user_agent ~ "proximic"){    return 403;  }  if ($http_user_agent ~ "psbot"){    return 403;  }  if ($http_user_agent ~ "PSurf15"){    return 403;  }  if ($http_user_agent ~ "psycheclone"){    return 403;  }  if ($http_user_agent ~ "ptd-crawler"){    return 403;  }  if ($http_user_agent ~ "Pump"){    return 403;  }  if ($http_user_agent ~ "Purebot"){    return 403;  }  if ($http_user_agent ~ "PycURL"){    return 403;  }  if ($http_user_agent ~ "Python"){    return 403;  }  if ($http_user_agent ~ "python-requests"){    return 403;  }
  265.         if ($http_user_agent ~ "Python-urllib"){    return 403;  }  if ($http_user_agent ~ "QRVA"){    return 403;  }  if ($http_user_agent ~ "QueryN\ Metasearch"){    return 403;  }  if ($http_user_agent ~ "QuerySeekerSpider"){    return 403;  }  if ($http_user_agent ~ "Radiation\ Retriever"){    return 403;  }  if ($http_user_agent ~ "RealDownload"){    return 403;  }  if ($http_user_agent ~ "Reaper"){    return 403;  }  if ($http_user_agent ~ "Recorder"){    return 403;  }  if ($http_user_agent ~ "ReGet"){    return 403;  }  if ($http_user_agent ~ "RepoMonkey"){    return 403;  }  if ($http_user_agent ~ "Riddler"){    return 403;  }  if ($http_user_agent ~ "RMA"){    return 403;  }  if ($http_user_agent ~ "rogerbot"){    return 403;  }  if ($http_user_agent ~ "RSurf15"){    return 403;  }  if ($http_user_agent ~ "Ruby"){    return 403;  }  if ($http_user_agent ~ "Runet-Research-Crawler"){    return 403;  }  if ($http_user_agent ~ "SafeSearch"){    return 403;  }  if ($http_user_agent ~ "Scooter"){    return 403;  }  if ($http_user_agent ~ "Scrapy"){    return 403;  }  if ($http_user_agent ~ "SearchBot"){    return 403;  }  if ($http_user_agent ~ "searchpreview"){    return 403;  }  if ($http_user_agent ~ "searchvoodoo"){    return 403;  }  if ($http_user_agent ~ "Seeker"){    return 403;  }  if ($http_user_agent ~ "semantic"){    return 403;  }  if ($http_user_agent ~ "SemrushBot"){    return 403;  }  if ($http_user_agent ~ "SEO\ search\ Crawler"){    return 403;  }  if ($http_user_agent ~ "Seopult"){    return 403;  }  if ($http_user_agent ~ "SEOsearch"){    return 403;  }  if ($http_user_agent ~ "SetLinks"){    return 403;  }  if ($http_user_agent ~ "SeznamBot"){    return 403;  }  if ($http_user_agent ~ "ShablastBot"){    return 403;  }  if ($http_user_agent ~ "Siphon"){    return 403;  }  if ($http_user_agent ~ "SISTRIX"){    return 403;  }  if ($http_user_agent ~ "SiteBot"){    return 403;  }  if ($http_user_agent ~ "sitecheck"){    return 403;  }  if ($http_user_agent ~ "SiteSnagger"){    return 403;  }  if ($http_user_agent ~ "Slurp"){    return 403;  }
  266.         if ($http_user_agent ~ "SlySearch"){    return 403;  }  if ($http_user_agent ~ "SmartDownload"){    return 403;  }  if ($http_user_agent ~ "SMTBot"){    return 403;  }  if ($http_user_agent ~ "SMUrlExpander"){    return 403;  }  if ($http_user_agent ~ "Snagger"){    return 403;  }  if ($http_user_agent ~ "Snake"){    return 403;  }  if ($http_user_agent ~ "snap.com"){    return 403;  }  if ($http_user_agent ~ "Snapbot"){    return 403;  }  if ($http_user_agent ~ "SNAPSHOT"){    return 403;  }  if ($http_user_agent ~ "Snoopy"){    return 403;  }  if ($http_user_agent ~ "socialmediascanner"){    return 403;  }  if ($http_user_agent ~ "sogou"){    return 403;  }  if ($http_user_agent ~ "Sogou"){    return 403;  }  if ($http_user_agent ~ "sohu\ agent"){    return 403;  }  if ($http_user_agent ~ "solomono"){    return 403;  }  if ($http_user_agent ~ "Soup"){    return 403;  }  if ($http_user_agent ~ "SpaceBison"){    return 403;  }  if ($http_user_agent ~ "SpankBot"){    return 403;  }  if ($http_user_agent ~ "spanner"){    return 403;  }  if ($http_user_agent ~ "spbot"){    return 403;  }  if ($http_user_agent ~ "spredbot"){    return 403;  }  if ($http_user_agent ~ "sproose"){    return 403;  }  if ($http_user_agent ~ "Sqworm"){    return 403;  }  if ($http_user_agent ~ "SSurf15"){    return 403;  }  if ($http_user_agent ~ "statdom"){    return 403;  }  if ($http_user_agent ~ "StatOnlineRuBot"){    return 403;  }  if ($http_user_agent ~ "Stripper"){    return 403;  }  if ($http_user_agent ~ "Sucker"){    return 403;  }  if ($http_user_agent ~ "suggybot"){    return 403;  }  if ($http_user_agent ~ "SuperBot"){    return 403;  }  if ($http_user_agent ~ "Superfeedr"){    return 403;  }  if ($http_user_agent ~ "SuperHTTP"){    return 403;  }  if ($http_user_agent ~ "Surfbot"){    return 403;  }  if ($http_user_agent ~ "SurveyBot"){    return 403;  }  if ($http_user_agent ~ "suzuran"){    return 403;  }  if ($http_user_agent ~ "SWeb"){    return 403;  }  if ($http_user_agent ~ "Synapse"){    return 403;  }  if ($http_user_agent ~ "Szukacz"){    return 403;  }  
  267.         if ($http_user_agent ~ "tAkeOut"){    return 403;  }  if ($http_user_agent ~ "Teleport"){    return 403;  }  if ($http_user_agent ~ "Telesoft"){    return 403;  }  if ($http_user_agent ~ "The\ Intraformant"){    return 403;  }  if ($http_user_agent ~ "TheNomad"){    return 403;  }  if ($http_user_agent ~ "TightTwatBot"){    return 403;  }  if ($http_user_agent ~ "Titan"){    return 403;  }  if ($http_user_agent ~ "toCrawl"){    return 403;  }  if ($http_user_agent ~ "trendictionbot"){    return 403;  }  if ($http_user_agent ~ "Triton"){    return 403;  }  if ($http_user_agent ~ "True_Robot"){    return 403;  }  if ($http_user_agent ~ "TSearcher"){    return 403;  }  if ($http_user_agent ~ "TSurf15"){    return 403;  }  if ($http_user_agent ~ "ttCrawler"){    return 403;  }  if ($http_user_agent ~ "turingos"){    return 403;  }  if ($http_user_agent ~ "TurnitinBot"){    return 403;  }  if ($http_user_agent ~ "TweetmemeBot"){    return 403;  }  if ($http_user_agent ~ "Twiceler"){    return 403;  }  if ($http_user_agent ~ "ubermetrics"){    return 403;  }  if ($http_user_agent ~ "Under\ the\ Rainbow"){    return 403;  }  if ($http_user_agent ~ "UnwindFetchor"){    return 403;  }  if ($http_user_agent ~ "URL\ Control"){    return 403;  }  if ($http_user_agent ~ "UrlDispatcher"){    return 403;  }  if ($http_user_agent ~ "urllib"){    return 403;  }  if ($http_user_agent ~ "URLSpiderPro"){    return 403;  }  if ($http_user_agent ~ "URLy\ Warning"){    return 403;  }  if ($http_user_agent ~ "User-Agent"){    return 403;  }  if ($http_user_agent ~ "uTorrent"){    return 403;  }  if ($http_user_agent ~ "Vacuum"){    return 403;  }  if ($http_user_agent ~ "VadixBot"){    return 403;  }  if ($http_user_agent ~ "VCI"){    return 403;  }  if ($http_user_agent ~ "veoozbot"){    return 403;  }  if ($http_user_agent ~ "virus\ bot"){    return 403;  }  if ($http_user_agent ~ "Virusdie"){    return 403;  }  if ($http_user_agent ~ "VoidEYE"){    return 403;  }  if ($http_user_agent ~ "voyager"){    return 403;  }  if ($http_user_agent ~ "Voyager"){    return 403;  }  
  268.         if ($http_user_agent ~ "W3\ SiteSearch\ Crawler"){    return 403;  }  if ($http_user_agent ~ "W3C"){    return 403;  }  if ($http_user_agent ~ "Wayback Machine"){    return 403;  }  if ($http_user_agent ~ "WBSearchBot"){    return 403;  }  if ($http_user_agent ~ "Weazel"){    return 403;  }  if ($http_user_agent ~ "Web\ Downloader"){    return 403;  }  if ($http_user_agent ~ "Web\ Image\ Collector"){    return 403;  }  if ($http_user_agent ~ "Web\ Spy"){    return 403;  }  if ($http_user_agent ~ "Web\ Sucker"){    return 403;  }  if ($http_user_agent ~ "WebAlta"){    return 403;  }  if ($http_user_agent ~ "WebAuto"){    return 403;  }  if ($http_user_agent ~ "Webbandit"){    return 403;  }  if ($http_user_agent ~ "WebBandit"){    return 403;  }  if ($http_user_agent ~ "WebCapture"){    return 403;  }  if ($http_user_agent ~ "Webclipping.com"){    return 403;  }  if ($http_user_agent ~ "webcollage"){    return 403;  }  if ($http_user_agent ~ "WebCopier"){    return 403;  }  if ($http_user_agent ~ "WebEMailExtrac"){    return 403;  }  if ($http_user_agent ~ "WebEnhancer"){    return 403;  }  if ($http_user_agent ~ "WebFetch"){    return 403;  }  if ($http_user_agent ~ "WebGo\ IS"){    return 403;  }  if ($http_user_agent ~ "WebHook"){    return 403;  }  if ($http_user_agent ~ "WebLeacher"){    return 403;  }  if ($http_user_agent ~ "weblist"){    return 403;  }  if ($http_user_agent ~ "WebmasterWorld"){    return 403;  }  if ($http_user_agent ~ "WebMiner"){    return 403;  }  if ($http_user_agent ~ "WebMirror"){    return 403;  }  if ($http_user_agent ~ "WebReaper"){    return 403;  }  if ($http_user_agent ~ "WebRecorder"){    return 403;  }  if ($http_user_agent ~ "WebSauger"){    return 403;  }  if ($http_user_agent ~ "WebSite"){    return 403;  }  if ($http_user_agent ~ "Website\ eXtractor"){    return 403;  }  if ($http_user_agent ~ "Website\ Quester"){    return 403;  }  if ($http_user_agent ~ "WebSpy"){    return 403;  }  if ($http_user_agent ~ "Webster"){    return 403;  }  if ($http_user_agent ~ "WebStripper"){    return 403;  }  if ($http_user_agent ~ "WebVulnCrawl"){    return 403;  }  
  269.         if ($http_user_agent ~ "WebWhacker"){    return 403;  }  if ($http_user_agent ~ "WebZIP"){    return 403;  }  if ($http_user_agent ~ "wegobot"){    return 403;  }  if ($http_user_agent ~ "Wells\ Search"){    return 403;  }  if ($http_user_agent ~ "WEP\ Search"){    return 403;  }  if ($http_user_agent ~ "Wget"){    return 403;  }  if ($http_user_agent ~ "Whacker"){    return 403;  }  if ($http_user_agent ~ "Widow"){    return 403;  }  if ($http_user_agent ~ "Windows\ 95"){    return 403;  }  if ($http_user_agent ~ "WISENutbot"){    return 403;  }  if ($http_user_agent ~ "WordPress"){    return 403;  }  if ($http_user_agent ~ "woriobot"){    return 403;  }  if ($http_user_agent ~ "WWW-Collector-E"){    return 403;  }  if ($http_user_agent ~ "WWWOFFLE"){    return 403;  }  if ($http_user_agent ~ "Xaldon"){    return 403;  }  if ($http_user_agent ~ "Xenu"){    return 403;  }  if ($http_user_agent ~ "Xenu's"){    return 403;  }  if ($http_user_agent ~ "x-Tractor"){    return 403;  }  if ($http_user_agent ~ "Yanga"){    return 403;  }  if ($http_user_agent ~ "Yeti"){    return 403;  }  if ($http_user_agent ~ "YottosBot"){    return 403;  }  if ($http_user_agent ~ "Zeus"){    return 403;  }  if ($http_user_agent ~ "Zeus\ Link\ Scout"){    return 403;  }  if ($http_user_agent ~ "zitebot"){    return 403;  }  if ($http_user_agent ~ "ZmEu"){    return 403;  }  if ($http_user_agent ~ "Zyborg"){    return 403;  }
  270.         # в файлах, начинающихся на «.» могут лежать пароли или оставшиеся настройки от Апача - отдавать это ни к чему.
  271.         location ~ /\. {
  272.         access_log off;
  273.         log_not_found off;
  274.         }
  275.    
  276.     # Wildcard include / Закоментили(отключили) дополнительные настройки
  277.    #include          /etc/nginx/conf.d/*.conf;
  278.  
  279. }
  280. # SSL PCI Compliance
  281.    ssl_session_cache   shared:SSL:10m;
  282.     ssl_protocols       TLSv1 TLSv1.1 TLSv1.2;
  283.     ssl_prefer_server_ciphers on;
  284.     ssl_ciphers        "ECDHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES128-SHA256:ECDHE-RSA-AES256-SHA:ECDHE-RSA-AES128-SHA:DHE-RSA-AES256-SHA256:DHE-RSA-AES128-SHA256:DHE-RSA-AES256-SHA:DHE-RSA-AES128-SHA:ECDHE-RSA-DES-CBC3-SHA:EDH-RSA-DES-CBC3-SHA:AES256-GCM-SHA384:AES128-GCM-SHA256:AES256-SHA256:AES128-SHA256:AES256-SHA:AES128-SHA:DES-CBC3-SHA:HIGH:!aNULL:!eNULL:!EXPORT:!DES:!MD5:!PSK:!RC4";
  285.        
  286.     # Error pages / Страницы ошибок
  287.    error_page          403          /error/403.html;
  288.     error_page          404          /error/404.html;
  289.     error_page          502 503 504  /error/50x.html;
  290.  
  291.     # Log format
  292.    log_format  main    '$remote_addr - $remote_user [$time_local] $request '
  293.                         '"$status" $body_bytes_sent "$http_referer" '
  294.                         '"$http_user_agent" "$http_x_forwarded_for"';
  295.     log_format  bytes   '$body_bytes_sent';
  296.     #access_log          /var/log/nginx/access.log  main;
  297.    access_log off;
  298. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement