Skip to content

Commit

Permalink
Merge pull request #6 from nishant-jain-94/dev-operations
Browse files Browse the repository at this point in the history
Added nginx.conf and added scripts to add hosts in the dev env
  • Loading branch information
nishant-jain-94 committed Aug 30, 2017
2 parents d76834d + 3854b19 commit 765010c
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 0 deletions.
16 changes: 16 additions & 0 deletions nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,20 @@ http {
proxy_pass http://localhost:3001;
}
}

server {
listen logs.ontology.stackroute.in;
server_name logs.ontology.stackroute.in;
location / {
proxy_pass http://localhost:5601;
}
}

server {
listen monitoring.ontology.stackroute.in;
server_name monitoring.ontology.stackroute.in;
location / {
proxy_pass http://localhost:9001;
}
}
}
33 changes: 33 additions & 0 deletions scripts/addHosts.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#!/bin/bash

# Path to host file
ETC_HOSTS=/etc/hosts;

# Default IP for hostname
IP="127.0.0.1";

addhost()
{
HOSTNAME=$1;
echo "$HOSTNAME"
HOSTS_LINE="$IP\s$HOSTNAME";
if [ -n "$(grep $HOSTNAME $ETC_HOSTS)" ]
then
echo "$HOSTNAME already exists: $(grep $HOSTNAME $ETC_HOSTS)";
else
echo "Adding $HOSTNAME to your $ETC_HOSTS";
sudo -- sh -c -e "echo '$HOSTS_LINE' >> $ETC_HOSTS";

if [ -n "$(grep $HOSTNAME $ETC_HOSTS)" ]
then
echo "$HOSTNAME was added successfully to $ETC_HOSTS";
else
echo "Failed to add $HOSTNAME";
fi
fi
}

while read host;
do
addhost $host;
done < "scripts/hosts";
8 changes: 8 additions & 0 deletions scripts/hosts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
explore.ontology.stackroute.in
rabbitmq.ontology.stackroute.in
neo4j.ontology.stackroute.in
api.ontology.stackroute.in
meta.ontology.stackroute.in
meta-api.ontology.stackroute.in
logs.ontology.stackroute.in
monitoring.ontology.stackroute.in

0 comments on commit 765010c

Please sign in to comment.