nginx屏蔽搜索引擎

在http字段下加入一个map做匹配引导

map $http_user_agent $limit_bots {
     default 0;
     ~*(baiduspider|google|soso|bing|yandex|sogou|yahoo|sohu-search|yodao|YoudaoBot|robozilla|msnbot|MJ12bot|NHN|Twiceler) 1;
     ~*(AltaVista|Googlebot|Slurp|BlackWidow|Bot|ChinaClaw|Custo|DISCo|Download|Demon|eCatch|EirGrabber|EmailSiphon|EmailWolf|SuperHTTP|Surfbot|WebWhacker) 1;
     ~*(Express|WebPictures|ExtractorPro|EyeNetIE|FlashGet|GetRight|GetWeb!|Go!Zilla|Go-Ahead-Got-It|GrabNet|Grafula|HMView|Go!Zilla|Go-Ahead-Got-It) 1;
     ~*(rafula|HMView|HTTrack|Stripper|Sucker|Indy|InterGET|Ninja|JetCar|Spider|larbin|LeechFTP|Downloader|tool|Navroad|NearSite|NetAnts|tAkeOut|WWWOFFLE) 1;
     ~*(GrabNet|NetSpider|Vampire|NetZIP|Octopus|Offline|PageGrabber|Foto|pavuk|pcBrowser|RealDownload|ReGet|SiteSnagger|SmartDownload|SuperBot|WebSpider) 1;
     ~*(Teleport|VoidEYE|Collector|WebAuto|WebCopier|WebFetch|WebGo|WebLeacher|WebReaper|WebSauger|eXtractor|Quester|WebStripper|WebZIP|Wget|Widow|Zeus) 1;
     ~*(Twengabot|htmlparser|libwww|Python|perl|urllib|scan|Curl|email|PycURL|Pyth|PyQ|WebCollector|WebCopy|webcraw) 1;
 }


再到server字段或者是location字段下加入if判断

  if ($limit_bots = 1) {  return 403;  }


id_rsa加密码和移除密码

增加密码

openssl rsa -aes256 -in your.key -out your.encrypted.key


移除密码

openssl rsa -in your.key -out your.open.key

id_rsa文件需要400的权限, 否则不能使用.


原文引用自https://stackoverflow.com/questions/42863913/key-load-public-invalid-format

linux系统日志清空

for I in `echo dmesg lastlog messages secure tallylog wtmp btmp maillog spooler yum.log`; do
echo > /var/log/$I;
done
history -c


supermicro IPMI/BMC nginx proxy

需要安装一个openresty或者nginx, 版本大于1.15.10

编译安装参考http://www.kvm.la/1043.html , openresty二进制包版本较低没有更新, 建议编译安装一份.

首先把IPMI的IP丢进一个ip.list的文件里面, 一行一个IP.

cat list.sh
#/bin/bash
i=1000  #vnc start port
b=2000 #wsi start port

stream_vnc_map=/etc/nginx/stream.vnc.map.conf
stream_bmc_map=/etc/nginx/stream.bmc.map.conf
http_vnc_map=/etc/nginx/http.vnc.map.conf
http_bmc_map=/etc/nginx/http.bmc.map.conf

#清空配置
echo > $stream_bmc_map
echo > $stream_vnc_map
echo > $http_vnc_map
echo > $http_bmc_map

#给IP分配统一的端口
for IP in `cat ./ip.list`;
do
i=`expr $i + 1` ;
b=`expr $b + 1` ;
echo $i         $IP';' >> $stream_vnc_map
echo $b 	$IP';' >> $stream_bmc_map
echo $IP 	$i';' >>  $http_vnc_map
echo $IP        $b';' >>  $http_bmc_map
done

nginx -s reload

阅读剩余部分...