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

Caddy から、Node.js のサーバーにリバースプロキシーで接続

0
Posted at

こちらと同じことを、Caddy で行います。
Nginx から、Node.js のサーバーにリバースプロキシーで接続

Node.js のプログラムの動作確認

$ http http://localhost:3000
HTTP/1.1 200 OK
Connection: keep-alive
Content-Type: text/plain
Date: Mon, 22 Jun 2026 03:04:54 GMT
Keep-Alive: timeout=5
Transfer-Encoding: chunked

hello world.

Caddy の設定ファイル

/etc/caddy/Caddyfile
:80 {
	root * /var/www

	file_server

	php_fastcgi unix//var/run/php/php8.5-fpm.sock

	handle_path /node* {
		reverse_proxy 127.0.0.1:3000
	}
}

Caddy の再起動

sudo systemctl restart caddy

動作確認

http http://localhost/node
0
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
0
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?