假定一个场景:某个网站它可能不希望被网络爬虫抓取,例如测试环境不希望被抓取,以免对用户造成误导,那么需要在该网站中申明,本站不希望被抓取.有如下方法: 方法一:修改nginx.conf,禁止网络爬虫的ua,返回403. server { listen 80; server_name 127.0.0.1; #添加如下内容即可防止爬虫 if ($http_user_agent ~* "qihoobot|Baiduspider|Googlebot|Googlebot-Mobile|Googlebot-…
当nginx配置 sendfile设置为on时,某些js文件中会出现奇怪的字符: ����������������� 不管怎么刷新,重启服务都无效: 通过google搜索之后发现原来是因为开启sendfile的原因! 将sendfile设置为off,则不再出现此问题! 这个可能是vagrant造成的吧! 又是一个坑踩过了…
虚拟机版本:6.0.4 r128413 (Qt5.6.2) linux:centos7/6 点击菜单栏中的设备->安装增强功能,再reboot 获取内核版本号 uname -r 查看yum的内核头文件是否存在,不存在wget下载安装 yum list | grep kernel-headers 不存在,获取新的内核rpm文件,并rpm安装到yum中: yum install wget wget http://vault.centos.org/7.6.1810/os/Source/SPackage…
限制php解析 1.有时候会根据目录来限制php解析: location ~ .*(diy|template|attachments|forumdata|attachment|image)/.*\.php$ { deny all; } 限制浏览器访问  1.使用 user_agent 控制客户端浏览器访问  location / { if ($http_user_agent ~ 'bingbot/2.0|MJ12bot/v1.4.2|Spider/3.0|YoudaoBot|Tomato|Gec…
环境根据http://www.cnblogs.com/zzzhfo/p/6032095.html配置 修改LB的/usr/local/nginx/conf/nginx.conf upstream static_pools { server ; } upstream dynamic_pools { server ; } server { listen ; server_name www.test.com; location / { root html; index index.html index…
set $mobile_request '0'; if ($http_user_agent ~* (Android|webOS|iPhone|iPod|BlackBerry)) { set $mobile_request '1'; } if ( $request_uri ~* (error)) { set $mobile_request '2'; } if ($mobile_request = '0') { rewrite ^.+ http://www.baidu.com/error.html;…
CAS (6) -- Nginx代理模式下浏览器访问CAS服务器网络顺序图详解 tomcat版本: tomcat-8.0.29 jdk版本: jdk1.8.0_65 nginx版本: nginx-1.9.8 cas版本: cas4.1.2 cas-client-3.4.1 参考来源: jasig.github.io:CAS protocol https://github.com/Jasig/java-cas-client 通过Proxy访问其它Cas应用 CAS负载均衡配置--SSL篇 CAS负…
CAS (5) -- Nginx代理模式下浏览器访问CAS服务器配置详解 tomcat版本: tomcat-8.0.29 jdk版本: jdk1.8.0_65 nginx版本: nginx-1.9.8 cas版本: cas4.1.2 cas-client-3.4.1 参考来源: jasig.github.io:CAS protocol https://github.com/Jasig/java-cas-client 通过Proxy访问其它Cas应用 CAS负载均衡配置--SSL篇 CAS负载均衡…
Apache和Nginx运行原理解析 原文:https://www.server110.com/nginx/201402/6543.html Web服务器 Web服务器也称为WWW(WORLD WIDE WEB)服务器,主要功能是提供网上信息浏览服务. 应用层使用HTTP协议. HTML文档格式. 浏览器统一资源定位器(URL). Web服务器常常以B/S(Browser/Server)方式提供服务.浏览器和服务器的交互方式如下: GET /index.php HTTP/1.1 +-------…
1 概述 acme.sh实现了acme协议,可以从Let's Encrypt生成免费的ssl证书用于实现https,本文介绍了常见的两种服务器Apache与Nginx上利用acme.sh配置https服务. 约定: APACHE_INSTALL_DIR --- Apache安装目录 NGINX_INSTALL_DIR --- Nginx安装目录 www.test.com --- 测试域名,请按需要换成自己的域名 2 准备工作 一个域名 一台云服务器 2.1 域名与服务器 域名与服务器直接买就好了…