Created
March 2, 2018 08:40
-
-
Save fabsrc/9e6ea9032148d44dd1798eff492cb139 to your computer and use it in GitHub Desktop.
Add additional locations in Nginx reverse proxy for AWS Elastic Beanstalk
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
files: | |
"/tmp/add_default_nginx_includes.sh": | |
mode: "000755" | |
owner: root | |
group: root | |
content: | | |
#!/usr/bin/env bash | |
grep /etc/nginx/default.d /tmp/deployment/config/#etc#nginx#conf.d#00_elastic_beanstalk_proxy.conf > /dev/null 2>&1 | |
if [ $? -eq 1 ] | |
then | |
echo "add new default includes line to nginx config" | |
sed -i '$iinclude /etc/nginx/default.d/*.conf;' /tmp/deployment/config/#etc#nginx#conf.d#00_elastic_beanstalk_proxy.conf | |
else | |
echo "nginx default includes line already added" | |
fi | |
"/opt/elasticbeanstalk/hooks/appdeploy/pre/65_add_default_nginx_includes.sh": | |
mode: "000755" | |
owner: root | |
group: root | |
content: | | |
#!/usr/bin/env bash | |
sh /tmp/add_default_nginx_includes.sh | |
"/opt/elasticbeanstalk/hooks/configdeploy/pre/65_add_default_nginx_includes.sh": | |
mode: "000755" | |
owner: root | |
group: root | |
content: | | |
#!/usr/bin/env bash | |
sh /tmp/add_default_nginx_includes.sh | |
"/etc/nginx/default.d/00_additional_routings.conf": | |
mode: "000755" | |
owner: root | |
group: root | |
content: | | |
location /test { | |
add_header Content-Type text/plain; | |
return 200 "Hello World"; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment