nginx通过传参做动态代理:可以访问http://172.20.47.38/console/?host=172.20.47.11, 来直接代理到gotty的172.20.47.11:50000 的websocket

 

可以将参数进行base64加密, 如:

然后通过访问http://172.20.47.38/console/?host=MTcyLjIwLjQ3LjM4 来访问gotty:

参考: http://man.hubwiz.com/docset/OpenResty.docset/Contents/Resources/Documents/set-misc-nginx-module.html#set_unescape_uri

nginx要添加set-misc-nginx-module模块, 具体安装方式如下:

配置文件如下, 逻辑为:

第一次访问时, $uri是/console/ 则进行set_decode_base64解码,设置cookie

然后再访问几个js文件, 匹配.js, js再调用ws

 

 

 

—- 旧的请求根目录版:

 

Categories: 未分类

1 Comment

Hairstyles For Girls · 07/05/2020 at 3:57 PM

Hello.This post was really interesting, especially because I was searching for thoughts on this issue last couple of days.

Leave a Reply

Avatar placeholder

Your email address will not be published. Required fields are marked *