diff --git a/README.md b/README.md index 6c760cd..42d31ec 100644 --- a/README.md +++ b/README.md @@ -20,6 +20,7 @@ Role Variables - caddy_www: /var/www/caddy - reverse_location: reverse destination point - reverse_port: port to redirect to +- rootws: yes/no activate websocket in the / path - websocket_path: path to websocket (optional) - websocket_localtion: reverse destination point for websocket config - websocket_port: websocket port to redirect to diff --git a/defaults/main.yml b/defaults/main.yml index be6b490..78cf673 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -12,4 +12,6 @@ reverse_port: 8080 vhost_name: default -websocket: no \ No newline at end of file +websocket: no + +rootws: no \ No newline at end of file diff --git a/templates/reverse.caddy.j2 b/templates/reverse.caddy.j2 index 59856c8..1cd099d 100644 --- a/templates/reverse.caddy.j2 +++ b/templates/reverse.caddy.j2 @@ -13,6 +13,9 @@ } proxy / http://{{ reverse_location }}:{{ reverse_port }} { +{% if rootws %} + websocket +{% endif %} transparent }