![](https://img-blog.csdnimg.cn/20201014180756925.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
nginx
文章平均质量分 56
nginx相关
篮球风云
这个作者很懒,什么都没留下…
展开
-
nginx配置proxy_pass中url末尾带/与不带/的区别
nginx配置proxy_pass时url末尾带“/”与不带“/”的区别如下:注意:当location为正则表达式匹配模式时,proxy_pass中的url末尾是不允许有"/"的,因此正则表达式匹配模式不在讨论范围内。proxy_pass配置中url末尾带/时,nginx转发时,会将原uri去除location匹配表达式后的内容拼接在proxy_pass中url之后。测试地址:htt...原创 2020-03-27 00:57:57 · 8496 阅读 · 1 评论 -
nginx之location匹配优先级及顺序
nginx通过server块中location配置用以匹配不同url访问:location配置方式主要包括精准匹配、普通匹配和正则匹配location = expression 精准匹配location expression 普通匹配location ^~ expression 普通匹配location ~ regex 正则匹配(区分大小写)location ~* regex...原创 2020-03-26 15:22:31 · 3381 阅读 · 0 评论 -
nginx+ssl+https
在使用nginx作为https提供服务时,如将证书通过nginx进行解析,tomcat协议还是提供http时,在程序中通过request.getScheme仍为http时,需要修改nginx配置以及tomcat下server.xml可实现,具体配置如下:proxy_set_header Host $host;proxy_set_header X-Real-IP $remote_...原创 2018-11-20 19:51:48 · 231 阅读 · 0 评论 -
nginx屏蔽http方法
在安全扫描中,一般会要求禁用除get和post以外的http方法,nginx可在location下通过以下配置实现:if (requestmethod! (GET∣POST)request_method !~ ^(GET|POST)requestmethod! (GET∣POST) ) {return 403;}...原创 2018-09-28 14:17:48 · 5558 阅读 · 0 评论