米狗

  • kubernets
  • docker
  • AWS
  • linux
  • nginx
nginx
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条评论 521点热度 0人点赞 duhongjun 阅读全文
nginx

Nginx 配置跨越支持

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

2022年8月28日 0条评论 516点热度 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条评论 517点热度 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条评论 572点热度 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条评论 547点热度 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条评论 541点热度 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条评论 565点热度 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条评论 493点热度 0人点赞 duhongjun 阅读全文
nginx

nginx如何设置禁止访问文件或文件夹

nginx如何设置禁止访问文件或文件夹目标: 1. 根目录 webroot; 2. 设置目标文件 /webroot/proj/deny.txt 不能访问; 做法: 1. 设置 nginx.conf ,添加一个“location”段落; 2. 尝试录入 location ^~ /project/deny.txt { alias   /webroot/proj/; deny  all; } 3. 解释 ^~ /project/ 意思是接受从外部访问(如浏览器)的 URL 地址,比如www.domain.com/proj…

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

nginx配置模板-网站https配置及80跳转443

nginx基本配置,网站https配置及http强调https ## THE IP INFOMATION OF "web-test.demo.com" ## upstream web-test.demo.com { server 10.100.40.101:32100; } ## THE SERVER INFOMATION OF "web-test.demo.com" ## server { listen 80; server_name web-test.demo.com; rewrite ^(.*)$ https…

2022年8月26日 0条评论 562点热度 0人点赞 duhongjun 阅读全文
123

近期文章

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

近期评论

您尚未收到任何评论。

COPYRIGHT © 2024 米狗. ALL RIGHTS RESERVED.

Theme Kratos Made By Seaton Jiang

沪ICP备2021019346号-1