Skip to content

Commit

Permalink
feat(nginx): Add nginx conf for staging environment
Browse files Browse the repository at this point in the history
  • Loading branch information
gupta-utkarsh committed Jan 21, 2018
1 parent e800f16 commit 8532269
Show file tree
Hide file tree
Showing 2 changed files with 63 additions and 1 deletion.
37 changes: 36 additions & 1 deletion aws/staging/Dockerrun.aws.json
@@ -1,12 +1,20 @@
{
"AWSEBDockerrunVersion": 2,
"volumes": [
{
"name": "nginx-proxy-conf",
"host": {
"sourcePath": "/var/app/current/proxy/conf.d"
}
}
],
"containerDefinitions": [
{
"name": "node-app",
"image": "<AWS_ACCOUNT_ID>.dkr.ecr.us-west-2.amazonaws.com/cloudcv/staging/nodejs:latest",
"portMappings": [
{
"hostPort": 80,
"hostPort": 6003,
"containerPort": 6003
}
],
Expand All @@ -24,6 +32,33 @@
"containerPort": 8000
}
]
},
{
"name": "nginx-proxy",
"image": "nginx",
"essential": true,
"memory": 128,
"portMappings": [
{
"hostPort": 80,
"containerPort": 80
}
],
"links": [
"django-app",
"node-app"
],
"mountPoints": [
{
"sourceVolume": "awseb-logs-nginx-proxy",
"containerPath": "/var/log/nginx"
},
{
"sourceVolume": "nginx-proxy-conf",
"containerPath": "/etc/nginx/conf.d",
"readOnly": true
}
]
}
]
}
27 changes: 27 additions & 0 deletions aws/staging/conf.d/default.conf
@@ -0,0 +1,27 @@
server {
listen 80;

server_name beta.cloudcv.org;
location / {
proxy_pass http://localhost:6003;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;

}
}

server {
listen 80;

server_name beta-api.cloudcv.org
location / {
proxy_pass http://localhost:8000;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
}

0 comments on commit 8532269

Please sign in to comment.