diff --git a/containers/traefik/templates/conf/cockpit.yml.j2 b/containers/traefik/templates/conf/cockpit.yml.j2 index 2c483a9..cb20516 100644 --- a/containers/traefik/templates/conf/cockpit.yml.j2 +++ b/containers/traefik/templates/conf/cockpit.yml.j2 @@ -1,20 +1,15 @@ http: routers: cockpit: - rule: "Host(`{{ vault_domain }}`) && (PathPrefix(`/cockpit/`) || Path(`/cockpit`))" + rule: "Host(`{{ vault_domain }}`) && (PathPrefix(`/admin/`) || Path(`/admin`))" entryPoints: https middlewares: - - force-trailing-slash - drop-xforwarded-proto service: cockpit tls: certresolver: wildcard middlewares: - cockpit-stripprefix: - stripPrefix: - prefixes: - - "/cockpit" drop-xforwarded-proto: headers: customrequestheaders: @@ -25,8 +20,8 @@ http: loadBalancer: serversTransport: nocertverify servers: - - url: "https://{{ vault_domain }}:9090" + - url: "https://{{ hostvars[inventory_hostname]['ansible_default_ipv4']['address'] }}:9090/admin/" serversTransports: nocertverify: - insecureSkipVerify: true \ No newline at end of file + insecureSkipVerify: true diff --git a/roles/cockpit/templates/cockpit.conf.j2 b/roles/cockpit/templates/cockpit.conf.j2 index 01409e5..e01488a 100644 --- a/roles/cockpit/templates/cockpit.conf.j2 +++ b/roles/cockpit/templates/cockpit.conf.j2 @@ -1,3 +1,4 @@ [WebService] -Origins = http://{{ inventory_hostname }} ws://{{ inventory_hostname }} https://{{ inventory_hostname }} wss://{{ inventory_hostname }} http://{{ hostvars[inventory_hostname]['ansible_default_ipv4']['address'] }}:9090 ws://{{ hostvars[inventory_hostname]['ansible_default_ipv4']['address'] }}:9090 https://{{ hostvars[inventory_hostname]['ansible_default_ipv4']['address'] }}:9090 wss://{{ hostvars[inventory_hostname]['ansible_default_ipv4']['address'] }}:9090 +Origins = https://{{ inventory_hostname }} wss://{{ inventory_hostname }} ProtocolHeader = X-Forwarded-Proto +UrlRoot=/admin