08-nginx
苦杏仁
心无旁骛!
展开
-
nginx的proxy_pass 路径转发规则
一、location匹配路径末尾没有 / location /sta { proxy_pass http://192.168.1.1/sta; } 外面访问 :http://外网IP/sta/sta1.html 相当于访问 :http://192.168.1.1/sta/sta1.html 二、location匹配路径末尾有 / 此时proxy_pass后面的路径需要分为以下四种情况讨论: (1)proxy_pass后面的路径只有域名且最后没有 / location /sta...转载 2020-08-01 10:54:30 · 884 阅读 · 0 评论 -
基于【OpenResty】部署应用层nginx以及nginx+lua开发hello world
1.前言: 一般做nginx相关开发的人员都会在nginx里去写lua脚本去处理自定义的一些特殊的业务逻辑 比如说:流量分发,自己用lua去写分发的逻辑,在分发层nginx里去写; 再比如说;要用lua去写多级缓存架构存取的控制逻辑,在应用层nginx里去写的; 还有热点数据的自动降级机制,也是用lua脚本在分发层nginx里去写去写降级机制的; 因为我们要用nginx+lua去开发,所以会选择用最流行的开源方案,就是用OpenResty; OpenResty:nginx+lua打包在一起,而原创 2020-07-23 22:59:33 · 269 阅读 · 0 评论 -
Nginx缓存配置-简单说明
1.基本缓存配置及配置说明 proxy_cache_path /path/to/cache levels=1:2 keys_zone=mycache:10m max_size=10g inactive=60m use_temp_path=off; server { # ... location / { proxy_cache mycache; proxy_cache_valid 200 1d; proxy_cache_use_stale error time原创 2020-07-07 11:25:52 · 631 阅读 · 1 评论 -
nginx转向配置
upstream tomcat_pre.sy-admin { server 127.0.0.1:1601 weight=10 max_fails=2 fail_timeout=30s ; } log_format realaddr_38753 '$remote_addr - $remote_user [$time_local] "$http_x_forwarde...原创 2019-10-11 09:44:32 · 547 阅读 · 0 评论