Giter Site home page Giter Site logo

mohammadhasanii / liara-load-balancer-nginx Goto Github PK

View Code? Open in Web Editor NEW
6.0 1.0 1.0 2 KB

This container allows you to distribute all your requests in Liara.ir internal network between 2 copies of the application container on your server side.

Home Page: https://boookito.ir

Dockerfile 100.00%
nginx liara loadbalancer loadbalancing nginx-proxy

liara-load-balancer-nginx's Introduction

Liara-Load-Balancer-Nginx

This container allows you to distribute all your requests in Liara.ir internal network between 2 copies of the application container on your server side

Logo

Usage/Examples

nginx.conf


user nginx;
worker_processes auto;

pid /tmp/nginx.pid;

events {

	worker_connections 1024;
}

http {

	client_body_temp_path /tmp/client_temp;
	proxy_temp_path /tmp/proxy_temp_path;
	fastcgi_temp_path /tmp/fastcgi_temp;
	uwsgi_temp_path /tmp/uwsgi_temp;
	scgi_temp_path /tmp/scgi_temp;

	include /etc/nginx/mime.types;
	default_type application/octet-stream;

	log_format main '$request_method $status $http_x_forwarded_for "$request_uri" "$http_referer" "$http_user_agent"';
      log_format alogformat "$time_local $scheme://$host:$server_port$request_uri";
	server_tokens off;
	sendfile on;
	keepalive_timeout 65;
	gzip on;
	access_log /dev/stdout;
	error_log stderr;



#All the backend servers that are deployed in Liara.ir, just enter the application name along with the port
#Just change this part
  upstream backend {

    server backend1:5000;
    server backend2:5000;
  }

	server {


		resolver 127.0.0.11 ipv6=off valid=5s;
		listen 80;
		location / {
                  add_header X-debug-message "A static file was served" always;
			proxy_set_header Host $host;
			proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
			proxy_pass http://backend;
		}
	}
}



}

Dockerfile


FROM nginx

COPY nginx.conf /etc/nginx/nginx.conf

Deploy to Liara.ir

  liara deploy --platform=docker --port=80

liara-load-balancer-nginx's People

Contributors

mohammadhasanii avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

bettercode-co

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.