Skip to content

hardik-aws/nginx-proxy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

About

  1. This repository will provide you Docker proxy image which will dynamicly genrate nginx configration for proxy_pass based on Ports you expose
  2. It will provide Nginx status page on diffrent port if you expose port 8888

Requirements

  1. Install Docker.
  2. Install docker-compose.
  3. Clone this repository

Setup

How to deploy in local ?

build image

$ cd <root of repository>
$ docker build -t proxy:latest .

run docker container

$ docker-compose up -d

Once your yask is in running state try open URL of Status

run Proxy using Amazon ECS

create a ECR repository to store image

to create a docker image go to AWS console > EC2 Container Service > Repositories

build image :

$ cd <root of repository>
$ docker build -t proxy:latest .

push image to ECR :

login

$ aws ecr get-login --region <aws-region>

This will provide you a long login command for AWS (Note : this will expiry after 8 hrs so you need to relogin)

tag Image

$ docker tag proxy:latest <ecr-reposiotory-url>:latest

push image

$ docker push <ecr-reposiotory-url>:latest

create a task defination

sample file for the ECS task defination is provided in the folder ecs inside this repostitory, you need to change some value in that defination

	"containerDefinitions": [{
		"volumesFrom": [],
		"memory": 1024, <<< change the RAM based on your requirment
		"extraHosts": null,
		"dnsServers": null,
		"disableNetworking": null,
		"dnsSearchDomains": null,
		"workingDirectory": null,
		"readonlyRootFilesystem": null,
		"image": "123456789123.dkr.ecr.us-east-1.amazonaws.com/proxy:latest", <<< change image with URL of your own ECR image
		"command": null,

once you made all require change go to AWS console > EC2 Container Service > Task Definitions and Create a Task Definition

create a Service

to create a service go to Newely created task defination and from Actions menu create service

Fill below value based on you requirment and Create Service

Cluster
Service name
Number of tasks
Minimum healthy percent
Maximum percent

Once Done new service will be added with number of task in your selected cluster

Check ELK

Once your yask is in running state try open URL of Status

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published