Skip to content
This repository has been archived by the owner on Nov 24, 2021. It is now read-only.

Commit

Permalink
Improve default templates, mostly by adding ACLs
Browse files Browse the repository at this point in the history
  • Loading branch information
danie1k committed Jan 21, 2021
1 parent 5438d2f commit de89a58
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 4 deletions.
14 changes: 11 additions & 3 deletions python/docker_network_monitor/templates/80.j2
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
listen docker-{{ hostname }}
bind *:443 interface eth0
bind *:80 interface eth0
mode http
option forwardfor
bind *:80 interface eth0

# SSL
bind *:443 interface eth0
redirect scheme https code 301 if !{ ssl_fc }

# Allow only requests for a valid FQDN
acl is_{{ hostname }} hdr(host) -i "{{ hostname }}.${DOMAIN_NAME}"
tcp-request content accept if is_{{ hostname }}
tcp-request content reject

option forwardfor
server {{ hostname }} {{ ip }}:{{ target_port }}
8 changes: 7 additions & 1 deletion python/docker_network_monitor/templates/default.j2
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
listen docker-{{ hostname }}
bind *:{{ source_port }} interface eth0
mode tcp
bind *:{{ source_port }} interface eth0

# Allow only requests for a valid FQDN
acl is_{{ hostname }} hdr(host) -i "{{ hostname }}.${DOMAIN_NAME}"
tcp-request content accept if is_{{ hostname }}
tcp-request content reject

server {{ hostname }} {{ ip }}:{{ target_port }}

0 comments on commit de89a58

Please sign in to comment.