Skip to content

Instantly share code, notes, and snippets.

@Proplex
Created June 11, 2018 19:51
Show Gist options
  • Save Proplex/e273438afec994f11308a6bcbbe2026d to your computer and use it in GitHub Desktop.
Save Proplex/e273438afec994f11308a6bcbbe2026d to your computer and use it in GitHub Desktop.
Here Lies My YAML
meta:
default:
azs: [z1]
nginx_config:
port: (( grab params.port || 443 ))
first_half: |
user nobody vcap;
worker_processes 1;
error_log /var/vcap/sys/log/nginx/error.log info;
events {
worker_connections 1024;
}
http {
server_tokens off;
upstream backend {
servers: (( cartesian-product "server " instance_groups.minio.networks.0.static_ips ":9000;\n" ))
servers_formatted: (( join "" meta.nginx_config.servers ))
second_half: |
ssl_certificate /var/vcap/jobs/nginx/etc/ssl_chained.crt.pem;
ssl_certificate_key /var/vcap/jobs/nginx/etc/ssl.key.pem;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers HIGH:!aNULL:!MD5;
location: |
location / {
proxy_pass_request_headers on;
proxy_pass http://backend;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $host;
}
}
}
nginx_conf: (( concat meta.nginx_config.first_half meta.nginx_config.servers_formatted "}\n server {\n listen " meta.nginx_config.port " default_server ssl;\n" meta.nginx_config.second_half meta.nginx_config.location ))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment