QingdaoU / OnlineJudgeDeploy

521 stars 360 forks source link

請問如何外部連線 #66

Closed jimmyhealer closed 3 years ago

jimmyhealer commented 3 years ago

我是用 WSL2 docker 架設,我不知道要如何外部連線,我對於 nginx 不是很了解。謝謝

renbaoshuo commented 3 years ago

您的 Docker 配置是什么样的?
如果是默认安装的话应该可以直接使用 https://wslip 访问。

jimmyhealer commented 3 years ago

我完全沒有修改,直接架設,但我試過http://wslip 並不能外部連線,而我的電腦可以。

renbaoshuo commented 3 years ago

WSL 的 IP 一般情况下可以使用 ifconfig 命令查询

如图中标橙色的部分即为 wsl 的 ip 。


如果需要外网访问,您需要将这个服务映射到外部。

jimmyhealer commented 3 years ago

那不好意思,請問如何把 服务映射到外部 ?

renbaoshuo commented 3 years ago

我个人不推荐映射 WSL 上的服务,因为 WSL 的 IP 会经常变动,建议您使用虚拟机(如 VMware 或 Virtual Box) 来搭建 OnlineJudge 服务,并在其中开启内网穿透服务。

我熟知的内网穿透服务提供商有这两个(仅供参考):Sakura Frp花生壳

jimmyhealer commented 3 years ago

好的感謝