随笔分类 - nginx
摘要:1.下载1.20.2源码包 [root@localhost service]# cd /data/build/nginx-1.20.2/ [root@localhost nginx-1.20.2]# ls auto CHANGES CHANGES.ru conf configure contrib
阅读全文
摘要:1.场景说明1.1代理服务器nginx192.168.1.8,业务服务器nginx172.16.88.211.2websocket代理配置说明 2.nginx配置 2.1业务服务器nginx配置 server { listen 8080 location /ws/ { proxy_pass http
阅读全文
摘要:1.报错信息 [root@ba6649b3a783 sbin]# ./nginx --t ./nginx: /lib64/libcrypt.so.1: version `XCRYPT_2.0' not found (required by ./nginx) ./nginx: /lib64/libc.
阅读全文
摘要:1.下载nginx源码包 https://nginx.org/en/download.htmlhttps://nginx.org/download/ 2.下载编译nginx依赖包,可根据自己需求进行下载 #pcre(处理正则表达式) http://downloads.sourceforge.net/
阅读全文
摘要:需求: nginx反向代理,其中有一个接口,为了安全考虑,只允许使用POST方法请求,其他方法返回405 代码: set $notlogin 0; if ($request_uri ~* "login") { set $notlogin '${notlogin}1'; } if ($request_
阅读全文
摘要:1.浏览器报错 2.解决问题 (1) 在nginx http中添加 http { map $http_upgrade $connection_upgrade { default upgrade; '' close; } } #在nginx的websocket中添加以下行 location /ws/
阅读全文
摘要:http { (1)HTTP Strict-Transport-Security缺失 add_header Strict-Transport-Security "max-age=63072000; includeSubdomains; preload";(2)web漏洞-缺少X-Frame-Opti
阅读全文
摘要:#问题描述 nginx使用systemctl管理失败,使用./nginx启动没有问题 #报错情况 #报错原因 原因是系统迁移后缺少“/var/tmp”目录,服务启动时需要检查临时目录,需要手动创建。 #问题处理 手动创建/var/tmp目录,mkdir /var/tmp #重启nginx服务 sys
阅读全文
摘要:1.1 什么是跨域问题? 在前端领域中,跨域是指浏览器允许向服务器发送跨域请求,从而克服Ajax只能同源使用的限制。 一般根据错误来定位是否是跨域问题,报错如下: 或者: 1.2 常见的跨域场景 URL 说明 是否允许通信 http://www.domain.com/a.js http://www.
阅读全文
摘要:nginx调优 nginx 配置文件模块: main全局设置: events stream四层代理模块 upstream 负载均衡设置:后端主机 server http模块 gzip 压缩作用 server模块 主机设置:port localtion 匹配页面位置,每个页面在什么位置上 localt
阅读全文