mirror of
https://github.com/rv-kip/rss-braider
synced 2025-04-22 11:25:09 +00:00
adding newrelic agent
This commit is contained in:
parent
5bde6804f5
commit
f0ff2b3098
29
.ebextensions/00_nginx_https_rw.config
Normal file
29
.ebextensions/00_nginx_https_rw.config
Normal file
@ -0,0 +1,29 @@
|
||||
files:
|
||||
"/tmp/45_nginx_https_rw.sh":
|
||||
owner: root
|
||||
group: root
|
||||
mode: "000644"
|
||||
content: |
|
||||
#! /bin/bash
|
||||
|
||||
CONFIGURED=`grep -c "return 301 https" /etc/nginx/conf.d/00_elastic_beanstalk_proxy.conf`
|
||||
|
||||
if [ $CONFIGURED = 0 ]
|
||||
then
|
||||
sed -i '/listen 8080;/a \ if ($http_x_forwarded_proto = "http") { return 301 https://$host$request_uri; }\n' /etc/nginx/conf.d/00_elastic_beanstalk_proxy.conf
|
||||
logger -t nginx_rw "https rewrite rules added"
|
||||
exit 0
|
||||
else
|
||||
logger -t nginx_rw "https rewrite rules already set"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
container_commands:
|
||||
00_appdeploy_rewrite_hook:
|
||||
command: cp -v /tmp/45_nginx_https_rw.sh /opt/elasticbeanstalk/hooks/appdeploy/enact
|
||||
01_configdeploy_rewrite_hook:
|
||||
command: cp -v /tmp/45_nginx_https_rw.sh /opt/elasticbeanstalk/hooks/configdeploy/enact
|
||||
02_rewrite_hook_perms:
|
||||
command: chmod 755 /opt/elasticbeanstalk/hooks/appdeploy/enact/45_nginx_https_rw.sh /opt/elasticbeanstalk/hooks/configdeploy/enact/45_nginx_https_rw.sh
|
||||
03_rewrite_hook_ownership:
|
||||
command: chown root:users /opt/elasticbeanstalk/hooks/appdeploy/enact/45_nginx_https_rw.sh /opt/elasticbeanstalk/hooks/configdeploy/enact/45_nginx_https_rw.sh
|
17
.ebextensions/99newrelic.config
Normal file
17
.ebextensions/99newrelic.config
Normal file
@ -0,0 +1,17 @@
|
||||
files:
|
||||
"/home/ec2-user/new_relic_servers_setup.sh":
|
||||
mode: "000755"
|
||||
owner: root
|
||||
group: root
|
||||
content: |
|
||||
#!/usr/bin/env bash
|
||||
printf "license_key: 26952a025640e073b97cd75045963b06014823f8" | \
|
||||
sudo tee /etc/newrelic-infra.yml
|
||||
printf "[newrelic-infra]\nname=New Relic Infrastructure\nbaseurl=http://download.newrelic.com/infrastructure_agent/linux/yum/el/6/x86_64\nenable=1\ngpgcheck=0" | \
|
||||
sudo tee /etc/yum.repos.d/newrelic-infra.repo
|
||||
yum -q makecache -y --disablerepo='*' --enablerepo='newrelic-infra'
|
||||
sudo yum install newrelic-infra -y
|
||||
|
||||
container_commands:
|
||||
set_up:
|
||||
command: /home/ec2-user/new_relic_servers_setup.sh
|
Loading…
x
Reference in New Issue
Block a user