随笔分类 - nginx
摘要:1、控制浏览器缓存 server { listem 80; server_name www.tomcats.com; location / { proxy_pass http://tomcats; expires 10s; #浏览器缓存10秒钟 #expires @22h30m #在晚上10点30的
阅读全文
摘要:nginx扩展 1. nginxconfig.io 直接浏览器中访问nginxconfig.io会重定向到https://www.digitalocean.com/community/tools/nginx?global.app.lang=zhCN,在这个里面可以进行配置,然后下载使用,在这个网站上
阅读全文
摘要:1. 正向代理服务器上不能访问网络时候设置 1.1编辑DNS配置文件 vi /etc/resolv.conf 1.2 添加DNS配置 # 设置互联网的域名解析,如果是虚拟机,可以设置为你的网关地址,比如192.168.52.2(vmware的网关地址) nameserver 114.114.114.
阅读全文
摘要:1. 安装stream模块 nginx默认不会编译stream模块的,需要在编译的时候,指定--with-stream ./configure --prefix=xxx --add-module=xxxx --add-module=xxx --with-stream 2. nginx配置代理mysq
阅读全文
摘要:测试使用的地址 http://192.168.52.120/static/index.html?param="><script>alert(1);</script>" http://192.168.52.120/static/index.html?param delete from user 扩展知
阅读全文
摘要:nginx验证内容: 1. 请求 IP:PORT/abc和IP:PORT/abc/对应的uri分别是什么 IP:PORT/abc 对应的uri为/abc IP:PORT/abc/ 对应的uri为/abc/ 2. 请求 IP:PORT/abc/def?name=theorydance#login 的u
阅读全文
摘要:user nginx; worker_processes 4; error_log /var/log/nginx/error_dq.log warn; pid /var/run/nginx_dq.pid; events { worker_connections 4096; } http { incl
阅读全文
摘要:SSL/TLS协议信息泄露漏洞(CVE-2016-2183)【原理扫描】 处理:ssl_ciphers HIGH:!aNULL:!MD5:!3DES; 这里面禁用DES SSL/TLS Bar Mitzvah Attack漏洞(CVE-2015-2808) 处理:服务器端禁止使用RC4加密算法,在s
阅读全文
摘要:1. 介绍 在nginx默认中,是没有echo模块的,在nginx.conf文件中存在echo会报错,需要安装echo模块。 2. 下载echo-nginx模块 下载链接:https://github.com/openresty/echo-nginx-module/ 将下载的tar.gz压缩包解压
阅读全文
摘要:1.proxy_http_version 设置代理的http协议版本,默认为http1.0,可选值为: 1.0 | 1.1 upstream http_backend { server 127.0.0.1:8080; keepalive 16; } server { # 针对ws协议进行升级处理 l
阅读全文
摘要:创建repo文件 vi /etc/yum.repo.d/nginx.repo [nginx-stable] name=nginx stable repo baseurl=http://nginx.org/packages/centos/7/$basearch/ gpgcheck=1 enabled=
阅读全文
摘要:ws协议在http之上,直接在http协议里面进行协议升级即可 正常的http请求正常,ws请求也正常,使用同一个端口 正常的ws请求截图 代理配置 http { include mime.types; default_type application/octet-stream; sendfile
阅读全文
摘要:server { listen 443 ssl; server_name www.theorydance.com; # 必填的两个属性ssl_certificate和ssl_certificate_key ssl_certificate /etc/nginx/ca/xxxxxxx.crt; ssl_
阅读全文
摘要:方式一: http { ... # 说明:一般使用http_origin来进行跨域控制,当不传递origin头的时候,就为这个里面的默认值,当传递有值得时候,才会走下面得正则匹配 map $http_referer $allow_cors { default 1; "~^https?://.*?\.
阅读全文
摘要:nginx配置证书,https与http均可访问 # HTTPS server server { listen 443 ssl; # 你自己的域名,与证书是绑定的 server_name www.theorydance.com; ssl_certificate /x/y/z.crt; ssl_cer
阅读全文
摘要:介绍 Nginx的rewrite模块即ngx_http_rewrite_module标准模块,主要功能是重写请求URI,也是Nginx默认安装的模块。rewrite模块会根据PCRE正则匹配重写URI,然后根据指令参数或者发起内部跳转再一次进行location匹配,或者直接进行30x重定向返回客户端
阅读全文
摘要:介绍 location路由匹配发生在HTTP请求处理的find-config配置查找阶段,主要功能是:根据请求的URI地址匹配location路由表达式,如果匹配成功,就执行location后面的上下文配置块。 location 4中配置 语法格式 location [=|~|~*|^~] 模式字符
阅读全文
摘要:执行文件默认安装在/usr/local/bin,资源文件默认安装在/usr/local/share 可以通过安装前指定 ./configure --prefix=/usr 修改执行文件和资源文件的默认安装路径,该示例修改后,分别目录为/usr/bin 和 /usr/share ./configure
阅读全文
摘要:nginx.conf worker_processes 1; events { worker_connections 1024; } http { include mime.types; default_type application/octet-stream; sendfile on; keep
阅读全文
摘要:1、先要分析对方系统是如何登录的,有的是通过表单提交用户名和密码,就直接进入到主页了,有的是通过接口登录,登录成功以后再重定向到主页;还有其他,这个直接连接到对方系统实现的复杂度跟目标系统有关。 2、如果是表单方式提交,直接得到action地址和用户名密码name,直接写入<a>,<iframe>标
阅读全文