route different proxy based on subdomain request in nginx

前端 未结 3 1858
梦毁少年i
梦毁少年i 2020-12-07 13:01

I have one dedicated server in that server I deployed 5 nodejs application.

domain name: www.nnd.com
dedicated server ip: xxx.xx.x.60

I had

3条回答
  •  清歌不尽
    2020-12-07 13:10

    create a virtual host for each

    server {
      server_name sub1.example.com;
      location / {
        proxy_pass http://127.0.0.1:xxxx;
      }
    }
    server {
      server_name sub2.example.com;
      location / {
        proxy_pass http://127.0.0.1:xxxx;
      }
    }
    

    And go on, change the port number to match the right port.

提交回复
热议问题