faith丶

导航

统计

随笔分类 -  N===nginx

反向代理
nginx域名隐性(地址栏域名不变)跳转
摘要:### 1、前提 系统介绍 系统A 域名: http://yhjmp.test.com 部署服务器:192.168.56.20 服务器名称:A-system 系统B 域名: http://yh.test.com或者http://yh.test.com/B-system【本文做了301永久跳转】 部署 阅读全文

posted @ 2021-11-22 18:15 faith丶 阅读(3418) 评论(1) 推荐(0) 编辑

docker/本地部署 Nginx 开启 Brotli 压缩算法
摘要:### 1、前言 在web应用中,为了节省流量,降低传输数据大小,提高传输效率,常用的压缩方式一般都是gzip,今天我们来介绍另外一种更高效的压缩方式brotli。 Brotli 是基于LZ77算法的一个现代变体、霍夫曼编码和二阶上下文建模。Google软件工程师在2015年9月发布了包含通用无损数 阅读全文

posted @ 2021-11-04 10:59 faith丶 阅读(1059) 评论(0) 推荐(0) 编辑

配置nginx https访问(使用openssl生成https证书)
摘要:### 1、创建https的ssl证书 1.1、创建秘钥 mkdir test && cd testopenssl genrsa -des3 -out server.key 2048注意:生成私钥,需要提供一个至少4位,最多1023位的密码。 1.2、生成CSR(证书签名请求) openssl re 阅读全文

posted @ 2021-11-03 18:32 faith丶 阅读(1198) 评论(0) 推荐(0) 编辑

访问前端项目时Http请求变成了HTTPS
摘要:问题:访问http://192.168.56.140,在浏览器返回https内容 问题产生原因:(index.html文件中配置) <meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests"> 这个时候 阅读全文

posted @ 2021-11-03 16:52 faith丶 阅读(1195) 评论(0) 推荐(0) 编辑

nginx rewrite 重定向 (url重定向)
摘要:### 1、rewrite指令语法 指令语法: rewrite regex replacement [flag]; s#regexp#replacement#g 默认值: none 应用位置: server、location、if 说明: 1) regex uri 2) rewrite是实现URL重 阅读全文

posted @ 2021-05-10 15:40 faith丶 阅读(809) 评论(0) 推荐(0) 编辑

nginx配置https
摘要:### 查看当前nginx 是否有--with-http_ssl_module模块【如果有则不需要安装】 [root@config dev-nginx-template]# nginx -V nginx version: nginx/1.16.1 built by gcc 4.8.5 2015062 阅读全文

posted @ 2021-04-30 12:35 faith丶 阅读(96) 评论(0) 推荐(0) 编辑

nginx访问认证【访问nginx需要用户名密码】
摘要:### 访问认证主要用于企业内部人员访问的地址上,例如:企业网站后台,MySQL客户端phpmyadmin、企业内部的CRM、WIKI网站平台等。 > 创建密码认证文件并进行授权 1)创建密码文件 yum install httpd-tools -y htpasswd -bc /wx/nginx/c 阅读全文

posted @ 2021-03-11 14:55 faith丶 阅读(515) 评论(0) 推荐(0) 编辑

nginx 的 location模块中 root 与 alias 区别
摘要:### 1.配置方式使用root 与 alias http { ... server: { location / { root /usr/share/nginx/html; } # root配置文件下载 - 页面404 location /downloadroot { root /etc/nginx 阅读全文

posted @ 2021-03-09 15:44 faith丶 阅读(125) 评论(0) 推荐(0) 编辑

nginx不停业务升级/增加编译模块
摘要:1.前提【编译安装nginx】 ######安装nginx yum install -y pcre-devel openssl-devel gcc >/dev/null groupadd -g 30001 wx useradd -u 30001 -g 30001 wx tar xf /scripts 阅读全文

posted @ 2020-10-10 18:30 faith丶 阅读(237) 评论(0) 推荐(0) 编辑

nginx 配置文件下载服务
摘要:1.创建存放下载文件目录,传入文件 # 注释:nginx服务为yum安装 [root@nginx ~]# mkdir /etc/nginx/downloadFile [root@nginx ~]# ll /etc/nginx/downloadFile/ total 32 -rw-r--r-- 1 r 阅读全文

posted @ 2020-09-24 16:18 faith丶 阅读(3014) 评论(0) 推荐(0) 编辑

nginx 配置访问认证
摘要:1.创建密码认证文件并进行授权 1)创建密码文件yum install httpd-tools -y htpasswd -bc /etc/nginx/htpasswd yiheng 123456 2)授权密码文件(属主属组与nginx启动用户一致即可) chmod 400 /etc/nginx/ht 阅读全文

posted @ 2020-09-24 16:06 faith丶 阅读(376) 评论(0) 推荐(0) 编辑

nginx 缓存服务器配置
摘要:1.服务器简介 Centos 7.4 nginx缓存服务器地址: 192.168.56.28 [root@nginx-cache ~] nginx前端图片服务器地址:192.168.56.30 [root@nginx-front ~] 2.nginx缓存服务器编译参数 [root@nginx-cac 阅读全文

posted @ 2020-09-23 16:53 faith丶 阅读(1486) 评论(0) 推荐(0) 编辑

SLB外部端口非80时---》转发到nginx---》URL跳转丢失端口的解决方案(反向代理)
摘要:配置nginx反向代理时遇到一个问题,当设置nginx监听80端口时转发请求没有问题。但一旦设置为监听其他端口,就一直跳转不正常; 如,访问欢迎页面时应该是重定向到登录页面,在这个重定向的过程中端口丢失了。【例: www.xxx.cn:13000/jenkins 》 www.xxx.cn/jenki 阅读全文

posted @ 2019-11-07 13:50 faith丶 阅读(1275) 评论(0) 推荐(0) 编辑

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