米狗

  • kubernets
  • docker
  • AWS
  • linux
  • nginx
中间件
nginx

nginx注册服务

将nginx添加为系统服务 则可以使用以下命令来管理nginx systemctl start nginx systemctl status nginx systemctl stop nginx systemctl restart nginx 直接编辑文件 vim /lib/systemd/system/nginx.service 将以下内容复制粘贴保存,路径按照实际路径填写。 [Unit] Description=nginx - high performance web server Documentation=…

2024年10月28日 0条评论 562点热度 0人点赞 megou 阅读全文
redis

redis注册服务

Linux安装redis并用systemctl方式配置自启动 下载并安装 redis下载页面 下载相应版本的redis至/usr/local目录下 wget http://download.redis.io/releases/redis-5.0.7.tar.gz 解压 tar -zvxf redis-5.0.7.tar.gz 编译 先到redis目录下 make 然后到src下 make install cd redis-5.0.7 make cd src mkdir -p /usr/loca/redis  mak…

2024年3月6日 0条评论 794点热度 0人点赞 megou 阅读全文
nginx

nginx跨域白名单配置

1、设置nginx允许所有域名跨域; add_header Access-Control-Allow-Origin *; add_header Access-Control-Allow-Origin $http_origin; 效果如下:   2、通过全局配置nginx白名单,仅能增加一个域名; add_header 'Access-Control-Allow-Origin' 'https://www.baidu.com';   3、通过在路径下配置判断方法赋值,参考链接: https://mi…

2024年3月1日 0条评论 676点热度 3人点赞 megou 阅读全文
nginx

nginx限制源地址

一、背景介绍 1、正常情况,nginx 限制ip访问方式:(根据remote_addr限制) # nginx http\server 块中配置 allow 192.168.6.0/16; # allow all; deny 1.2.3.4/32; # deny all; 2、当经过waf或者cdn等代理后(remote_addr总是waf或者cdn等上一步代理地址) 3、确认上层代理是否将用户IP传递到http_x_forwarded_for中 4、一般http_x_forwarded_for中第一个地址为用户IP…

2024年1月31日 0条评论 730点热度 0人点赞 megou 阅读全文
nginx

nginx基础安全配置

网站运行过程中通常会遇到部分安全问题,通过nginx的add_header可以达到部分安全防护配置需求,常规安全配置参考如下,设置完毕后可以通过安全扫描工具进行扫描,附上免费的安全扫描网站。 https://www.immuniweb.com/websec/ #设置跨域支持 add_header Access-Control-Allow-Origin "*"; #设置网站https强制访问 add_header Strict-Transport-Security "max-age=63072000; include…

2022年11月3日 0条评论 671点热度 0人点赞 duhongjun 阅读全文
nginx

nginx健康检查

nginx提供健康检查功能,用于检测后端服务不可用时是否转发。 nginx开源版本提供被动健康检查,即应用调用时来进行判断后端服务是否可用,时效性差点; nginx商业版提供主动健康检查,可以通过nginx内置模块来监控后端服务,若发现不可用时则从组内踢出,相对于被动更加智能灵活。 HTTP Health Checks Monitor the health of HTTP servers in an upstream group by sending periodic health checks, includin…

2022年10月19日 0条评论 731点热度 0人点赞 duhongjun 阅读全文
nginx

PKI通讯证书生成教程

1. 生成CA证书 mkdir ca ##创建根证书私钥 openssl genrsa -out ca/root-key.pem 1024 #创建证书请求 openssl req -new -out ca/ca-req.csr -key ca/root-key.pem #按照提示输入对应的内容 You are about to be asked to enter information that will be incorporated into your certificate request. What you…

2022年10月18日 0条评论 621点热度 0人点赞 duhongjun 阅读全文
docker

Using Docker Secrets With Docker Compose

Using Docker Secrets With Docker Compose Today I tried to create a docker secret for a Docker Swarm stack. Why? The secret is encrypted and you cannot read it. I’ve used … September 22, 2020Last modified: September 30, 2021 Tags that this post has been filed u…

2022年9月26日 0条评论 630点热度 0人点赞 duhongjun 阅读全文
nginx

nginx重新编译添加新模块

nginx重新编译添加新模块 找到安装nginx的源码根目录,如果没有的话下载新的源码 http://nginx.org tar xvzf nginx-1.3.2.tar.gz 查看ngixn版本极其编译参数 /usr/local/nginx/sbin/nginx -V 进入nginx源码目录 cd nginx-1.3.2 以下是重新编译的代码和模块 ./configure --prefix=/usr/local/nginx--with-http_stub_status_module --with-http_ssl…

2022年8月28日 0条评论 625点热度 0人点赞 duhongjun 阅读全文
nginx

Nginx负载均衡中后端节点服务器健康检查

Nginx负载均衡中后端节点服务器健康检查 - 运维笔记(转发) 正常情况下,nginx做反向代理,如果后端节点服务器宕掉的话,nginx默认是不能把这台realserver踢出upstream负载集群的,所以还会有请求转发到后端的这台realserver上面,这样势必造成网站访问故障。虽然nginx可以在localtion中启用proxy_next_upstream来解决返回给用户的错误页面,如下: 例如公司的网站访问的时候全部变成404页面,最后发现是后端的一台服务器不可用,直接访问那台后台的服务器的时候,返回…

2022年8月28日 0条评论 507点热度 0人点赞 duhongjun 阅读全文
1234

近期文章

  • nginx注册服务
  • vsftpd加密传输配置
  • vsftpd安装配置
  • keepalived注册服务
  • redis注册服务

近期评论

您尚未收到任何评论。

COPYRIGHT © 2024 米狗. ALL RIGHTS RESERVED.

Theme Kratos Made By Seaton Jiang

沪ICP备2021019346号-1