Nginx简要梳理

安装

https://gper.club/articles/7e7e7f7ff3g5agc0g6b

常用指令

在这里插入图片描述

日志

logs/access.log
logs/error.log

在这里插入图片描述

虚拟主机

代理

正向代理
    为客户端工作,与客户端一体,隐藏了客户端
反向代理
    为服务端工作,与服务端一体,隐藏了服务端    
location匹配

在这里插入图片描述
在这里插入图片描述

负载均衡

upstream

在这里插入图片描述

第三方模块:fair   <https://gper.club/articles/7e7e7f7ff3g5dgc2g6d>  响应世间

在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

动静分离

在这里插入图片描述
在这里插入图片描述

限流

  • 速率
    在这里插入图片描述
    在这里插入图片描述
  • 并发量
    在这里插入图片描述
    在这里插入图片描述

黑名单

在这里插入图片描述
在这里插入图片描述
include black.conf

问题1:

  • 描述
    前端vue工程build后的dist路径下有.gz压缩文件,使用docker打nginx镜像后无法加载页面。
  • 解决方式
    在nginx配置文件中server部分中添加以下配置:
#Gzip相关配置
gzip on;
gzip_comp_level 5;
gzip_min_length 1k;
gzip_buffers 4 16k;
gzip_proxied any;
gzip_vary on;
gzip_types application/javascript application/x-javascript text/javascript text/css text/xml application/xhtml+xml application/xml application/atom+xml application/rdf+xml application/rss+xml application/geo+json application/json application/ld+json application/manifest+json application/x-web-app-manifest+json image/svg+xml text/x-cross-domain-policy;
gzip_static on;  
gzip_disable "MSIE [1-6]\."; 
#end Gzip相关配置 
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值