Skip to content

Instantly share code, notes, and snippets.

@x-cray
Last active December 23, 2015 20:37
Show Gist options
  • Save x-cray/2752e1b406ca3bb86bfe to your computer and use it in GitHub Desktop.
Save x-cray/2752e1b406ca3bb86bfe to your computer and use it in GitHub Desktop.
{% macro hosts(environment, domain_prefix='') -%}
# {{ environment }} hosts
acl host_{{ environment }}:test-server hdr_dom(host) -i -m str {{ domain_prefix }}mesos-test.domain.com
{%- endmacro %}
{% macro bind(service, environment) -%}
use_backend cluster_{{ environment }}:{{ service }} if host_{{ environment }}:{{ service }}
{%- endmacro %}
frontend external_https_in
bind :443 ssl crt domain_com.pem
http-response set-header Strict-Transport-Security max-age=31536000;\ preload
http-response set-header X-Frame-Options DENY
http-response set-header X-Content-Type-Options nosniff
{{ hosts('staging', 'staging-') }}
{{ hosts('production') }}
# Staging bindings
{{ bind('test-server', 'staging') }}
# Production bindings
{{ bind('test-server', 'production') }}
frontend external_http_in
bind :80
{{ hosts('staging', 'staging-') }}
{{ hosts('production') }}
# Staging bindings
{{ bind('test-server', 'staging') }}
# Production bindings
{{ bind('test-server', 'production') }}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment