Add websocket config support

This commit is contained in:
Wilfried OLLIVIER 2019-02-01 17:45:14 +01:00
parent a1902ffa0a
commit 85f0c12a11
2 changed files with 10 additions and 0 deletions

View file

@ -20,6 +20,10 @@ Role Variables
- reverse_location: reverse destination point - reverse_location: reverse destination point
- reverse_port: port to redirect to - reverse_port: port to redirect to
- websocket_path: path to websocket (optional)
- websocket_localtion: reverse destination point for websocket config
- websocket_port: websocket port to redirect to
- vhost_name: name of the vhost - vhost_name: name of the vhost
Dependencies Dependencies

View file

@ -16,6 +16,12 @@
transparent transparent
} }
{% if websocket_path is defined %}
proxy {{ websocket_path }} http://{{ websocket_location }}:{{ websocket_port }} {
websocket
}
{% endif %}
log {{ caddy_logs }}/{{ vhost_name }}/access.log { log {{ caddy_logs }}/{{ vhost_name }}/access.log {
rotate_size 100 rotate_size 100
rotate_age 30 rotate_age 30