a96f8ce4b5d084ab295ccd0687ad532311a8476c
sie-snest-gw\350\256\276\350\256\241\344\270\216\345\256\236\347\216\260.md
| ... | ... | @@ -106,6 +106,25 @@ |
| 106 | 106 | |
| 107 | 107 | [[http://iidp.chinasie.com:9999/iidpminio/sie-snest-gw/img_7.png]] |
| 108 | 108 | |
| 109 | +### 3.6 升级和降级 |
|
| 110 | + |
|
| 111 | +考虑兼容已有系统,或者升级后发现出现问题无法第一时间修复的场景,gw需要支持随时随地的降级回原来的使用方式, |
|
| 112 | +整个操作非常简单,只需要修改```nginx.conf```中代理到 /api 的配置项即可。 |
|
| 113 | + |
|
| 114 | +``` |
|
| 115 | + location ^~/api/ { |
|
| 116 | + proxy_http_version 1.1; |
|
| 117 | + proxy_set_header Host $host; |
|
| 118 | + proxy_set_header X-Real-IP $remote_addr; |
|
| 119 | + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; |
|
| 120 | + client_max_body_size 2048m; |
|
| 121 | + |
|
| 122 | + proxy_pass http://iidp-app:8060/; # 使用已有的代理至master节点的方式 |
|
| 123 | + proxy_pass http://localhost:8060; # 使用localhost,由于共享网络空间,只会走内核协议栈不会走网线 |
|
| 124 | + proxy_pass http://unix:/socket/gw-iidp.socket:/api/; # 使用unix domain socket |
|
| 125 | + } |
|
| 126 | +``` |
|
| 127 | + |
|
| 109 | 128 | ## 4. 总结 |
| 110 | 129 | 通过上述设计与实现方案,sie-snest-gw 网关能够在不修改现有Nginx代码的前提下,提供 app 维度的动态服务注册与发现能力,并通过高效的Unix Domain Socket通信机制,提升系统的整体性能。采用Golang实现的高性能边车服务,与Nginx共同运行,确保系统的高可用性和可扩展性。 |
| 111 | 130 |