Use caddy instead of socat for http proxying
This commit is contained in:
@@ -51,16 +51,16 @@
|
||||
container_wants: "{{ _service_container_wants }}"
|
||||
container_auto_update: "{{ service_auto_update }}"
|
||||
|
||||
- name: Socat for http of {{ service_name }}
|
||||
- name: Caddy socket proxy for http of {{ service_name }}
|
||||
ansible.builtin.include_role:
|
||||
name: socat
|
||||
name: caddy_socket_proxy
|
||||
when: service_container_http_port > 0
|
||||
vars:
|
||||
socat_service_name: "{{ service_name }}"
|
||||
socat_target_http_port: "{{ service_container_http_port }}"
|
||||
socat_container_ip: >-
|
||||
caddy_socket_proxy_service_name: "{{ service_name }}"
|
||||
caddy_socket_proxy_target_http_port: "{{ service_container_http_port }}"
|
||||
caddy_socket_proxy_container_ip: >-
|
||||
{{ service_container_ip | ansible.utils.ipmath(257) if _service_static_ip else '' }}
|
||||
socat_auto_update: "{{ service_auto_update }}"
|
||||
caddy_socket_proxy_auto_update: "{{ service_auto_update }}"
|
||||
|
||||
- name: Socat for socket published ports of {{ service_name }}
|
||||
ansible.builtin.include_role:
|
||||
|
||||
@@ -7,7 +7,7 @@ _service_container_networks: >-
|
||||
}]
|
||||
+ (
|
||||
[{
|
||||
'name': service_name ~ '-socat',
|
||||
'name': service_name ~ '-caddy-socket-proxy',
|
||||
'ip': service_container_ip | ansible.utils.ipmath(256) if _service_static_ip else ''
|
||||
}] if service_container_http_port > 0 else []
|
||||
)
|
||||
@@ -33,7 +33,7 @@ _service_container_requires: >-
|
||||
_service_container_wants: >-
|
||||
{{
|
||||
service_wants
|
||||
+ ([service_name + '-socat.socket'] if service_container_http_port > 0 else [])
|
||||
+ ([service_name + '-caddy-socket-proxy.socket'] if service_container_http_port > 0 else [])
|
||||
+ ([service_name + '-oauth2-proxy.socket'] if _service_oauth2_proxy else [])
|
||||
+ _service_container_publish_socket_ports
|
||||
| map(attribute='name')
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
_service_native_socket: "{{ service_domains | length > 0 and service_container_http_port == 0 }}"
|
||||
|
||||
_service_socket_path: >-
|
||||
/run/{{ service_name ~ ('-socat' if not _service_native_socket else '' ) }}.sock
|
||||
/run/{{ service_name ~ ('-caddy-socket-proxy' if not _service_native_socket else '' ) }}.sock
|
||||
|
||||
_service_replacement_host_header:
|
||||
Host: "{{ service_name }}:{{ service_container_http_port }}"
|
||||
|
||||
Reference in New Issue
Block a user