米狗

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

nginx 配置间接监控 udp 负载均衡健康检查

nginx 配置间接监控 udp 负载均衡健康检查 1.nginx 搭建 2.nginx.conf 文件的配置 user root; worker_processes 1; error_log logs/error.log info; #pid logs/nginx.pid; events { worker_connections 1024; } http { server { listen 80; # status interface location /status { healthcheck_status h…

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

基于nginx proxy dns server

基于nginx proxy dns server 原理实际行就是stream模式,因为nginx 支持基于stream 模式的lb同时支持(tcp.udp)以下是一个简单的配置 环境准备 docker-compose 文件 version: "3" services: lb: image: openresty/openresty:alpine volumes: - "./nginx-lb.conf:/usr/local/openresty/nginx/conf/nginx.conf" - "./dns.log:/v…

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

nginx的log、upstream和server

nginx的log、upstream和server 一、log     首先一个log格式化的例子。 #配置格式main的log log_format main '$host $status [$time_local] $remote_addr [$time_local] $request_uri ' '"$http_referer" "$http_user_agent" "$http_x_forwarded_for" ' '$bytes_sent $request_time $sent_http_x_cache_…

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

Nginx 配置跨越支持

Nginx 配置跨越支持 用你最美的姿态,去「跨域」那座山。 在日常的开放中,我们经常遇到跨域的问题,常用的处理方式都是在代码层添加 cors 支持,但若你有 Nginx 配置权限,在 Nginx 上处理跨域将使得程序异常简单和高效。 代理 假设我们的前端域名为 example.com,API 服务架设在 api.example.com 域名下,那我们可以通过代理的形式来配置跨越请求,具体的配置为: 在 Nginx 的 example.com 虚拟主机文件中配置如下的代理 配置成功重启后,前端即可用 example…

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

Nginx log日志参数详解

$args #请求中的参数值 $query_string #同 $args $arg_NAME #GET请求中NAME的值 $is_args #如果请求中有参数,值为"?",否则为空字符串 $uri #请求中的当前URI(不带请求参数,参数位于$args),可以不同于浏览器传递的$request_uri的值,它可以通过内部重定向,或者使用index指令进行修改,$uri不包含主机名,如"/foo/bar.html"。 $document_uri #同 $uri $document_root #当前请求的文档根目录或…

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

企业nginx内网基础配置及目录跳转配置

nginx内网常规配置 ## THE IP ADDRESS OF "bpsrms.demo.com.local" ## upstream bpsrms.demo.com.local { server 10.99.11.141:6060; } ## THE SERVER INFOMATION OF "bpsrms.demo.com.local" ## server { listen 80; server_name bpsrms.demo.com.local; access_log /usr/local/nginx/l…

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

nginx四层代理配置

nginx支持4层代理,可以代理常规tcp/udp端口。 stream { log_format proxy '$remote_addr [$time_local]' '$protocol $status $bytes_sent $bytes_received' '$session_time "$upstream_addr" ' '"$upstream_bytes_sent" "$upstream_bytes_received" "$upstream_connect_time"'; access_log //app…

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

nginx配置访问静态文件

nginx配置访问静态文件         location /apple-app-site-association {                 alias /home/nginx13/nginx/html/apple-app-site-association;                 }         location /noahpayh5 {                       alias /app/nginx-1.16.1/html/noahpayh5;               …

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

使用Nginx设置基本HTTP身份验证

使用Nginx设置基本HTTP身份验证 第1步 - 安装Apache Tools 需要htpassword命令来配置将限制对目标网站的访问的密码。此命令是apache2-utils程序包的一部分,因此第一步是安装该程序包。 1 sudo apt-get install apache2-utils 步骤2 - 设置HTTP基本身份验证凭据 在此步骤中,运行网站的用户创建密码。 该密码和关联的用户名将存储在指定的文件中。密码将被加密,文件名可以是任何名称。在这里,我们使用文件/etc/nginx/.htpasswd和用…

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

nginx获取真实ip地址

Accepting the PROXY Protocol This article explains how to configure NGINX and NGINX Plus to accept the PROXY protocol, rewrite the IP address of a load balancer or proxy to the one received in the PROXY protocol header, configure simple logging of a client’s I…

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

近期文章

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

近期评论

您尚未收到任何评论。

COPYRIGHT © 2024 米狗. ALL RIGHTS RESERVED.

Theme Kratos Made By Seaton Jiang

沪ICP备2021019346号-1