LoginSignup
1
1

Dify on WSL2に外部のPCからアクセスできない

Last updated at Posted at 2024-05-09

Difyの問題ではないですが、localhost以外からのアクセスができなかったので、会社のSlackで聞いたらスペシャリストが教えてくれたのでメモとして残す。
最近はクラウド使ったり、環境はインフラの人がやってくれることが多いの一人でやるとしんどいけど、まあためになる。

必要なのはポートフォーワードの設定

まず、Powershellを管理者モードで立ち上げて、wslのIPを調べる

 wsl -e hostname -I

結果はこれ

172.21.35.156 172.17.0.1 172.30.0.1

続いて以下で設定する

netsh interface portproxy add v4tov4 listenaddress=* listenport=80 connectaddress=172.21.35.156 connectport=80

設定の確認をする

 netsh interface portproxy show all

結果はこれ

ipv4 をリッスンする:         ipv4 に接続する:

Address         Port        Address         Port
--------------- ----------  --------------- ----------
*               80          172.21.35.156   80

これで社内の端末同士でホスト名を使ってブラウザからDifyにアクセスができた。

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1