0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

apache nextjs リバースプロキシ 設定方法

Last updated at Posted at 2022-10-03

=================================
apache + nextjs + リバースプロキシで設定する

1,下記のモジュールが入っていることを確認する。
httpd -M

proxy_module (shared)
lbmethod_byrequests_module (shared)
proxy_balancer_module (shared)
proxy_http_module (shared)

2.サブドメインを一個追加
cd /etc/httpd/conf/httpd.confに追加


ServerName dev.xxx.jp
DocumentRoot /home/htdocs/dev.xxx.jp

3.ssl証明書を追加
/usr/bin/certbot

4.reverse proxyになるように修正

ProxyRequests Off
ProxyPass / http://localhost:3000
ProxyPassReverse / http://localhost:3000

3.再起動
apachectl configtest
systemctl restart httpd

これで、nextjsを起動するとreverseProxyされていました。
nextjsの運用方針が問題だわ・・・

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?