Skip to content

Instantly share code, notes, and snippets.

@adamgins
Created November 23, 2014 23:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save adamgins/0c0258d6e1b8203fd051 to your computer and use it in GitHub Desktop.
Save adamgins/0c0258d6e1b8203fd051 to your computer and use it in GitHub Desktop.
option_settings:
- option_name: AWS_SECRET_KEY
value: <SOMESECRET>
- option_name: AWS_ACCESS_KEY_ID
value: <SOMEKEY>
- option_name: PORT
value: 8081
- option_name: ROOT_URL
value: <SOMEURL>
- option_name: MONGO_URL
value: <SOMEMONGOURL>
- namespace: aws:elasticbeanstalk:container:nodejs
option_name: ProxyServer
value: nginx
option_name: GzipCompression
value: true
- namespace: aws:elasticbeanstalk:container:nodejs:staticfiles
option_name: /public
value: /public
container_commands:
01_nginx_static:
command: |
sed '/\s*location\s*\/.*/i \
location ~ ^/(images/|img/|javascript/|js/|css/|stylesheets/|font/|fonts/|flash/|media/|static/|robots.txt|humans.txt|favicon.ico) {\
root /var/app/current/bundle/static;\
access_log off;\
expires max;\
proxy_set_header Upgrade $http_upgrade;\
proxy_set_header Connection "upgrade";\
proxy_set_header Host $host;\
}\
\
location ~* \.(js|css)$ {\
root /var/app/current/bundle/static_cacheable;\
access_log off;\
expires max;\
proxy_set_header Upgrade $http_upgrade;\
proxy_set_header Connection "upgrade";\
proxy_set_header Host $host;\
}\
' /tmp/deployment/config/#etc#nginx#conf.d#00_elastic_beanstalk_proxy.conf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment