Add _a analytics handler to caddy

This commit is contained in:
Tobias Reisinger 2023-12-18 09:17:09 +01:00
parent 13100548b9
commit 6c6ade1b9a
Signed by: serguzim
GPG key ID: 13AD60C237A28DFE
3 changed files with 14 additions and 2 deletions

View file

@ -35,3 +35,11 @@
header_up Host {http.reverse_proxy.upstream.hostport}
}
}
(analytics) {
handle_path /_a/* {
reverse_proxy https://analytics.serguzim.me {
header_up Host {http.reverse_proxy.upstream.hostport}
}
}
}

View file

@ -26,12 +26,14 @@
src: Caddyfile.j2
dest: "{{ (config_path, 'Caddyfile') | path_join }}"
mode: "0644"
notify: Reload caddy
- name: Copy snippets file
ansible.builtin.copy:
src: snippets
dest: "{{ (config_path, 'snippets') | path_join }}"
mode: "0644"
notify: Reload caddy
- name: Create sites-config directory
ansible.builtin.file:

View file

@ -5,6 +5,8 @@ reitanlage_oranienburg_svc:
www_domain: true
port: 80
caddy_extra: |
import analytics
header /images/* Cache-Control "max-age=31536000"
header /assets/* Cache-Control "max-age=2629800"
header /user/themes/* Cache-Control "max-age=2629800"