随笔分类 -  nginx

摘要:server { listen 8910 ssl; server_name localhost,xxx.xxx.com; client_max_body_size 2048m; #ssl on; ssl_certificate ssl/xxx.crt; ssl_certificate_key ssl 阅读全文
posted @ 2022-11-16 10:22 chenjianwen 阅读(268) 评论(0) 推荐(0) 编辑
摘要:1.隐藏版本信息 1.在nginx.conf里面添加 在 http{ server_tokens off;} 2.在当前的conf目录下编辑php-fpm配置文件,如fastcgi.conf或fcgi.conf。(这个配置文件名也可以自定义的,根据具体文件名修改): 找到 fastcgi_param 阅读全文
posted @ 2022-08-25 16:45 chenjianwen 阅读(79) 评论(0) 推荐(0) 编辑
摘要:1.前言:nginx自带目录索引,功能简单、样式也不好看,而且长文件名还显示不全,使用fancyindex插件来做索引,配上一个漂亮的主题还有搜索的功能,使界面看起来赏心悦目。 2.软件版本 web:Nginx 1.14.0 fancy: fancyindex V0.4.3 fancy-theme: 阅读全文
posted @ 2021-07-01 14:30 chenjianwen 阅读(2208) 评论(0) 推荐(0) 编辑
摘要:server { #获取url完整请求 set $URL $scheme://$http_host$request_uri; #根据获取的URL匹配一些限制字符,满足条件拒绝访 #这里匹配 远程代码执行漏洞- "\x03\x00\x00/*\xE0\x00\x00\x00\x00\x00Cookie 阅读全文
posted @ 2021-06-03 11:50 chenjianwen 阅读(2655) 评论(0) 推荐(0) 编辑
摘要:1.直接上nginx配置文件 注意: 后端端口使用wss:proxy_pass https://wss_8; 后端端口使用ws :proxy_pass http://wss_8; upstream wss_8{ server 127.0.0.1:8004; } ### server { listen 阅读全文
posted @ 2021-02-09 10:41 chenjianwen 阅读(7008) 评论(0) 推荐(0) 编辑
摘要:访问会以下载文件的方式将获取到的值保存在文件中 upstream docker_2 { server 10.17.172.244:8080; } server { listen 81; server_name localhost; access_log /var/log/nginx/mytest_a 阅读全文
posted @ 2021-02-08 11:52 chenjianwen 阅读(686) 评论(0) 推荐(0) 编辑
摘要:1.匹配url:https://bby.ios.xxx.com:8081/zd?sid=15&key=repx_2530 匹配到sid的值根据sid值进行代理分发 2.达到效果:请求https://bby.ios.xxx.com:8081/xxxx?sid=xxx&xxxxx 根据sid的值转发到对 阅读全文
posted @ 2021-02-08 11:46 chenjianwen 阅读(5596) 评论(0) 推荐(0) 编辑
摘要:1.开发环境:以下列出的是部分必要库,详细请安装项目内的requirements.txt Python==3.6.8rc1 注意:不能使用python3.7以上版本,有版本兼容问题 Django==2.1.3 注意:2.2版本以上有兼容性问题 channels==2.1.4 channels-red 阅读全文
posted @ 2020-03-18 10:33 chenjianwen 阅读(487) 评论(0) 推荐(0) 编辑
摘要:1、Nginx运行工作进程数量 Nginx运行工作进程个数一般设置CPU的核心或者核心数x2。如果不了解cpu的核数,可以top命令之后按1看出来,也可以查看/proc/cpuinfo文件 grep ^processor /proc/cpuinfo | wc -l。 2、Nginx运行CPU亲和力 阅读全文
posted @ 2019-12-30 18:58 chenjianwen 阅读(741) 评论(0) 推荐(0) 编辑
摘要:cat /etc/nginx/nginx.conf cat /etc/nginx/conf.d/dddjs_game_analys_https_8081.conf 阅读全文
posted @ 2019-12-20 11:40 chenjianwen 阅读(318) 评论(0) 推荐(0) 编辑
摘要:No 'Access-Control-Allow-Origin' header is present on the requested resource 1.跨域指的是浏览器不能执行其它网站的脚本,它是由浏览器的同源策略造成的,是浏览器对JavaScript 施加的安全限制。 2.浏览器在执行脚本的 阅读全文
posted @ 2019-08-14 17:14 chenjianwen 阅读(67051) 评论(0) 推荐(0) 编辑
摘要:nginx取 $remote_addr 当做真实ip,而事实上,$http_X_Forwarded_For 才是用户真实ip,$remote_addr只是代理上一层的地址 解决方案: 在 http 模块 加 set_real_ip_from 172.17.10.125; #上一层代理IP地址 rea 阅读全文
posted @ 2019-04-28 17:16 chenjianwen 阅读(7796) 评论(0) 推荐(1) 编辑
摘要:user webroot; worker_processes 4; worker_cpu_affinity 1000 0100 0010 0001; worker_rlimit_nofile 65506; error_log /opt/nginx/logs/error.log; #error_log /var/log/nginx/error.log notice; #error... 阅读全文
posted @ 2017-11-24 16:10 chenjianwen 阅读(287) 评论(0) 推荐(0) 编辑
摘要:http { upstream docker { server 192.168.88.106:10001; server 192.168.88.106:10002; server 192.168.88.106:10003; } server { listen 81; server_name loca 阅读全文
posted @ 2017-05-07 12:51 chenjianwen 阅读(274) 评论(0) 推荐(0) 编辑
摘要:Varnish,Nginx搭建缓存服务器 Varnish,Nginx搭建缓存服务器 一. varnish 1.安装pcre库,兼容正则表达式 # tar -zxvf pcre-8.10.tar.gz # cd pcre-8.10 # ./configure --prefix=/usr/local/p 阅读全文
posted @ 2017-01-17 10:12 chenjianwen 阅读(1240) 评论(0) 推荐(0) 编辑
摘要:1.前期准备: client:192.168.4.1 eth0 proxy:192.168.4.5 eth0 web1:192.168.4.100 eth0 内容2 web2:192.168.4.200 eth0 内容1 生产环境中内容应该是一样的 2.拓扑图如下: 3.配置好web1和web2的n 阅读全文
posted @ 2016-12-23 14:13 chenjianwen 阅读(3384) 评论(0) 推荐(0) 编辑
摘要:创建加密访问网站,端口443 注意:一般生成的目录,应该放在nginx/conf/ssl目录 1.创建服务器证书密钥文件 server.key: openssl genrsa -des3 -out server.key 1024 输入密码,确认密码,自己随便定义,但是要记住,后面会用到。 2.创建服 阅读全文
posted @ 2016-12-23 10:34 chenjianwen 阅读(1352) 评论(0) 推荐(0) 编辑
摘要:问题:当启动nginx和php-fpm时,使用netstat -tunap查看到大量TIME_WAIT连接 由于不知道原因,害怕是受到攻击,马上killall nginx 和php-fpm 会不会是80端口被攻击造成的?尝试修改nginx的80端口为8081,但结果同样是产生大量TIME_WAIT连 阅读全文
posted @ 2016-12-05 21:22 chenjianwen 阅读(7017) 评论(0) 推荐(0) 编辑
摘要:http错误码大全 http://en.wikipedia.org/wiki/List_of_HTTP_status_codes 响应码由三位十进制数字组成,它们出现在由HTTP服务器发送的响应的第一行。响应码分五种类型,由它们的第一位数字表示:1.1xx:信息,请求收到,继续处理2.2xx:成功, 阅读全文
posted @ 2016-11-09 20:40 chenjianwen 阅读(362) 评论(0) 推荐(0) 编辑
摘要:Nginx压力测试工具之WebBench Nginx压力测试工具之WebBench 在Apache中有自带的ab命令可以测试服务的压力,而nginx没有自带的命令,必须要采用第三方软件来测试,今天就简单介绍一下webbench对nginx的压力测试,压力测试是对系统管理员和运维人员必须的,可以很清晰 阅读全文
posted @ 2016-07-24 20:31 chenjianwen 阅读(962) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示