1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

ngrokでHTTPSサーバーを公開する方法

Posted at

ぷちハマりしたのでメモ

ngrok

ngrokとはローカルで開発したサーバーをインターネットに公開するサービスです。
リバースプロキシしてる感じに近い。

いつもの方法

httpのサーバーを公開する方法

# ポート番号3000の場合
ngrok http 3000

httpsの場合

mkcertなどでサーバー証明書を作成してHTTPS化した場合、URLはフルで指定する。

ngrok http https://localhost:3000

おまけ、visit siteを表示しない方法

ngrokで公開したサーバーに接続するとき"visit site"ボタンが現れる。
これはプログラムからAPIを呼び出したとき邪魔になる。

リクエストヘッダーに"ngrok-skip-browser-warning"を指定すればスキップできる。
(valueはなんでもいい。)

1
0
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
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?