Update to caddy2

This commit is contained in:
Wilfried OLLIVIER 2020-05-19 21:28:43 +02:00
parent 96fbf95ec1
commit 790f42bbb8
4 changed files with 7 additions and 26 deletions

View File

@ -18,7 +18,6 @@ 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_location: reverse destination point for websocket config
- websocket_port: websocket port to redirect to
@ -51,4 +50,3 @@ Needs galaxy-vagrant to run tests
Ensure galaxy-vagrant is up
ansible-playbook -i tests/inventory tests/test.yml

View File

@ -16,6 +16,6 @@ websocket: no
websocket_location: localhost
proxy_rule: no
proxy_location: localhostœ
proxy_location: localhost
rootws: no

View File

@ -1,6 +1,6 @@
galaxy_info:
author: Wilfried OLLIVIER
description: Push caddy reverse config file
description: Push caddy (2) reverse config file
company: none
license: WTFPL

View File

@ -12,35 +12,18 @@
X-Frame-Options "DENY"
}
proxy / http://{{ reverse_location }}:{{ reverse_port }} {
{% if rootws %}
websocket
{% endif %}
transparent
}
reverse_proxy http://{{ reverse_location }}:{{ reverse_port }}
{% if websocket %}
proxy {{ websocket_path }} http://{{ websocket_location }}:{{ websocket_port }} {
websocket
}
reverse_proxy {{ websocket_path }} http://{{ websocket_location }}:{{ websocket_port }}
{% endif %}
{% if proxy_rule %}
proxy {{ proxy_path }} http://{{ proxy_location }}:{{ proxy_port }} {
transparent
}
reverse_proxy {{ proxy_path }} http://{{ proxy_location }}:{{ proxy_port }}
{% endif %}
log {{ caddy_logs }}/{{ vhost_name }}/access.log {
rotate_size 100
rotate_age 30
rotate_keep 10
}
errors {{ caddy_logs }}/{{ vhost_name }}/errors.log {
rotate_size 100
rotate_age 30
rotate_keep 10
log {
output file {{ caddy_logs }}/{{ vhost_name }}/vhost.log
}
}