Add _a analytics handler to caddy
This commit is contained in:
		
							parent
							
								
									13100548b9
								
							
						
					
					
						commit
						6c6ade1b9a
					
				
					 3 changed files with 14 additions and 2 deletions
				
			
		| 
						 | 
				
			
			@ -30,8 +30,16 @@
 | 
			
		|||
}
 | 
			
		||||
 | 
			
		||||
(faas) {
 | 
			
		||||
		rewrite * /function/{args[0]}{uri}
 | 
			
		||||
		reverse_proxy https://faas.serguzim.me {
 | 
			
		||||
	rewrite * /function/{args[0]}{uri}
 | 
			
		||||
	reverse_proxy https://faas.serguzim.me {
 | 
			
		||||
		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}
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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:
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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"
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Reference in a new issue