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