存档

‘nginx’ 分类的存档

使用certbot创建证书

2022年3月12日 没有评论

1.安装 certbot 1 yum install certbot python2-certbot-nginx 2.如果网站已存在忽略这步,否则新建网站到 nginx。 3. 给 http 添加证书 123 # 添加证书# 如果Nginx配置文件不在/usr/local/nginx/conf目录,则需要指定对应的目录certbot certonly --nginx --nginx-server-root=/usr/local/nginx/conf 12 ...

分类: nginx 标签:

Linux 安装&卸载 Mellanox 网卡驱动

2022年3月10日 没有评论

在 redhat7.6 服务器上面安装 Mellanox MCX4121A 网卡驱动的教程: Mellanox 已经被 Nvidia 收购,Mellanox 官网已经跳转到 Nvidia,很多教程的驱动连接都已经失效。 我这里对应的驱动是:http://www.mellanox.com/page/mlnx_ofed_eula?mtag=linux_sw_drivers&mrequest=downloads&mtype=ofed&mver=MLNX_OFED-4.7-3.2.9.0&mname=MLNX_OFED_LINUX-4.7-3.2.9.0-rhel7.6-x86_64.tgz 其它版本的驱动可以在这个页面找到: 一、安装 1)下载相应操作系统驱动 Mellanox 驱动 2)解压安装驱动 ...

分类: nginx 标签:

通过批处理批量获取局域网mac地址

2022年3月8日 2 条评论

新建文本文件getMac.bat,输入如下内容: 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748 @echo off mode con cols=50 lines=20 & color 1f title=获取内网MAC地址 if exist GetMAC.txt del /q /s GetMAC.txt set start=1set top=1set end=254set War=192.168.1cls echo                获取局域网中的MAC地址&nbs...

分类: nginx 标签:

mac 安装nginx php环境

2022年2月11日 没有评论

➜  etc brew install nginx ==> Installing dependencies for nginx: pcre, openssl ==> Installing nginx dependency: pcre ==> Downloading https://homebrew.bintray.com/bottles/pcre-8.38.el_capitan.bottle.tar.gz ######################################################################## 100.0% ==> Pouring pcre-8.38.el_capitan.bottle.tar.gz 🍺  /usr/local/Cellar/pcre/8.38: 203 files, 5.4M ==> Installing nginx dependency: openssl ...

分类: nginx 标签: ,

centos7 设置 nginx 开机自启动

2022年2月11日 没有评论

centos7 设置 nginx 开启自启动,这里是指以 yum 的方式安装的。 启动服务 1 systemctl start nginx.service 设置开机自启 1 systemctl enable nginx.service

分类: nginx 标签:

Nginx极简入门教程

2022年2月9日 1 条评论

本教程会告诉你 Nginx 是如何工作的,其背后的概念有哪些,以及如何优化以提升应用程序的性能。还会介绍如何安装、如何启动、运行 Nginx。如果你对 Nginx 已经有所了解,或者你希望了解更多,这个教程也会对你非常有帮助。 本教程包括三节: 基础概念——你可以了解命令(directive)与环境或者上下文(context)的区别、继承模式,以及 Nginx 选择服务器区块的顺序,还有安装位置。 性能管理——提升速度的诀窍。我们将会讲解 gzip、缓存、缓冲区以及超时设置。 SSL 设置——讲解用 HTTPS 来提供内容的设置步骤。 为了可以方便地找到正确...

分类: nginx 标签: , , , , , ,

nginx sub_filter 过滤及替换响应内容

2022年1月1日 没有评论

查找并替换上游服务器的 Accept-Encoding 设为空值,以禁用压缩,是因为 sub_filter 只能处理未经压缩的内容;又 sub_filter 一般只替换 text/html 且仅工作一次,不符合需求,故对配置稍做微调。 12345678 location / {    ...     proxy_set_header Accept-Encoding '';    sub_filter_types *;    sub_filter_once off;    sub_filter 'a.com' 'b.com'; &n...

分类: nginx 标签:

Nginx 403 error: directory index of [folder] is forbidden

2022年1月1日 没有评论

try_files $uri $uri/ / =404; 当使用如上配置访问目录 URI 时,提示 directory index of [folder] is forbidden。 这种情况是由于 nginx worker 进程对目录没有访问权限。 检查修改 root 目录文件夹权限为 755,所有者为 nginx 进程所有者,一般是www。 如果无法修改权限,可以去掉 $uri/ 后面的斜线,或者说删掉这个参数。 try_files $uri / =404;

分类: nginx 标签:

解决 mysql 1594 错误

2020年11月19日 没有评论

1.查看show slave status\G发现 Last_SQL_Errno: 1594 Last_SQL_Error: Relay log read failure: Could not parse relay log event entry. The possible reasons are: the master's binary log is corrupted (you can check this by running 'mysqlbinlog' on the binary log), the slave's relay log is corrupted (you can check this by running 'mysqlbinlog' on the relay log), a network problem, or a bug in the master's or slave's MySQL code. If you want to check the master's binary log or slave's relay log, you ...

分类: nginx 标签:

nginx permanent 和 redirect 的区别

2020年11月13日 没有评论

permanent: 永久性重定向,请求日志中的状态码为301。 redirect: 临时重定向,请求日志中的状态码为302。 从实现功能的角度上去看,permanent 和 redirect 是一样的,都是把旧网址重定向到新网址。不存在好坏,也不存在什么性能上的问题。但是对seo会有影响,这里要根据需要做出选择。  

分类: nginx 标签: