Skip to content

RaihanIIUC/Forntend-Deploy-Using-VPC-with-Load-Balancer

Repository files navigation

set UP VPC

vpc-form-filled

set up NAT

nat-form-filled

create route inside NAT

nat-router--form

create VM form private IP template instance

vm-private-ip-template-filled

Load Balance Setup

vpc-public-ip-template

we create a public ip available vm instance template so that we can make a load balance cloing the publically setted template.

Inside LoadBalance

cd /etc/nginx ls sudo nano nginx.conf change this conf file as needed :

`events { # empty placeholder }

http {

server {
    listen 80;

    location / {
        proxy_pass http:https://frontend-raihan;
    }

    location /api/ {
        rewrite ^/api/(.*)$ /$1 break;
        proxy_pass http:https://backend-raihan;
    }
}

upstream frontend-raihan {
    server 11.10.10.12:80;
    server 13.10.10.14:80;
}

upstream backend-raihan {
    server 10.10.0.5:8000;
    server 11.10.10.6:8080;
}

}`

location /api/ { rewrite ^/api/(.*)$ /$1 break; proxy_pass http:https://backend-raihan; }

upstream backend-raihan { server 10.10.0.5:8000; server 11.10.10.6:8080; } set two backend there so that whenever you have huge request it will auto transfer user to other one.

set up frontend

  • https://github.com/nodesource/distributions take v-16 binary version
  • sudo corepack enable to enable yarn
  • clone this to there
  • yarn
  • npm install
  • npm run dev

Backend port setup

  • open BaseUrl.js file and change the port for backend.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published