High Availability Website Simulation using Nginx-1.17.6 Load Balancer

start nginx
tasklist /fi “imagename eq nginx.exe”
upstream web {
server 127.0.0.1:8000;
server 127.0.0.1:9000;
#you can add as many ports as you like
}
server {
listen 80;
server_name localhost;
location / {
proxy_pass http://web;
}
}
include mysite.conf
nginx -s reload
{{ host }}:{{ port }}
def index(request):
host = request.get_host()
port = request.get_port()
return render(request, ‘index.html’, {‘host’:host, ‘port’:port})
python manage.py runserver <port>

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store