LoginSignup
4
5

More than 5 years have passed since last update.

Nginx でリバースプロキシ設定する方法

Posted at

前提

サーバOS: ContOS7

手順

設定ファイルを修正

sudo vi /etc/nginx/conf.d/default.conf

以下の通りに修正

/etc/nginx/conf.d/default.conf
server {
    listen       80;
    server_name  localhost;

    location / {
        # 以下の2行に修正 (今回は 80番ポート → 3000 番ポートに振る設定にする)
        proxy_pass http://localhost:3000;
        proxy_set_header Host $http_host;
    }

...

}

設定反映

Nginx をリロードする

sudo systemctl reload nginx

以上で完了。

4
5
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
4
5