diff --git a/README.md b/README.md index 9e5f560..6c760cd 100644 --- a/README.md +++ b/README.md @@ -23,6 +23,7 @@ Role Variables - websocket_path: path to websocket (optional) - websocket_localtion: reverse destination point for websocket config - websocket_port: websocket port to redirect to +- websocket: yes/no - enable websocket block in config file - vhost_name: name of the vhost Dependencies diff --git a/defaults/main.yml b/defaults/main.yml index 1dcc34f..be6b490 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -10,4 +10,6 @@ caddy_www: /var/www/caddy reverse_location: localhost reverse_port: 8080 -vhost_name: default \ No newline at end of file +vhost_name: default + +websocket: no \ No newline at end of file diff --git a/templates/reverse.caddy.j2 b/templates/reverse.caddy.j2 index 3c1beb2..59856c8 100644 --- a/templates/reverse.caddy.j2 +++ b/templates/reverse.caddy.j2 @@ -16,7 +16,7 @@ transparent } -{% if websocket_path is defined %} +{% if websocket %} proxy {{ websocket_path }} http://{{ websocket_location }}:{{ websocket_port }} { websocket }