Simplify haproxy config

This commit is contained in:
Ivan R. 2024-10-15 14:14:26 +05:00
parent b6bf3fe01f
commit efb49d0099
No known key found for this signature in database
GPG key ID: 56C7BAAE859B302C

View file

@ -32,30 +32,35 @@ frontend www
acl host_mastodon_tor hdr(host) -i mcomfyzeyibt2unmkttoxa2li2dzpsljcp3sasrioqsks4ayrl5kk2ad.onion acl host_mastodon_tor hdr(host) -i mcomfyzeyibt2unmkttoxa2li2dzpsljcp3sasrioqsks4ayrl5kk2ad.onion
http-request redirect scheme https if !{ ssl_fc } !host_mastodon_tor http-request redirect scheme https unless { ssl_fc } || host_mastodon_tor
http-request set-header X-Forwarded-Proto https if { ssl_fc } http-request set-header X-Forwarded-Proto https if { ssl_fc }
http-request set-header X-Forwarded-Proto http if !{ ssl_fc } http-request set-header X-Forwarded-Proto http if !{ ssl_fc }
acl host_mastodon hdr(host) -i m.comfycamp.space acl host_mastodon hdr(host) -i m.comfycamp.space
acl acl_s3 hdr(host) -i s3.comfycamp.space acl path_streaming_api path_beg /api/v1/streaming
acl acl_comfycamp hdr(host) -i comfycamp.space use_backend mastodon_streaming if host_mastodon path_streaming_api
acl acl_vaultwarden hdr(host) -i vault.comfycamp.space use_backend mastodon_streaming if host_mastodon_tor path_streaming_api
acl acl_minio hdr(host) -i minio.comfycamp.space
acl acl_git hdr(host) -i git.comfycamp.space
acl matrix-host hdr(host) -i matrix.comfycamp.space matrix.comfycamp.space:443
acl matrix-path path_beg /_matrix
acl matrix-path path_beg /_synapse/client
use_backend mastodon_streaming if host_mastodon { path_beg /api/v1/streaming }
use_backend mastodon_streaming if host_mastodon_tor { path_beg /api/v1/streaming }
use_backend mastodon if host_mastodon || host_mastodon_tor use_backend mastodon if host_mastodon || host_mastodon_tor
use_backend minio if acl_s3
use_backend matrix if matrix-host matrix-path acl host_matrix hdr(host) -i matrix.comfycamp.space matrix.comfycamp.space:443
use_backend minio_console if acl_minio acl path_matrix path_beg /_matrix
use_backend vaultwarden if acl_vaultwarden acl path_matrix path_beg /_synapse/client
use_backend comfycamp if acl_comfycamp use_backend matrix if host_matrix path_matrix
use_backend forgejo if acl_git
acl host_s3 hdr(host) -i s3.comfycamp.space
use_backend minio if host_s3
acl host_comfycamp hdr(host) -i comfycamp.space
use_backend comfycamp if host_comfycamp
acl host_vaultwarden hdr(host) -i vault.comfycamp.space
use_backend vaultwarden if host_vaultwarden
acl host_minio hdr(host) -i minio.comfycamp.space
use_backend minio_console if host_minio
acl host_git hdr(host) -i git.comfycamp.space
use_backend forgejo if host_git
frontend matrix-federation frontend matrix-federation
bind *:8448 ssl crt /usr/local/etc/haproxy/certs bind *:8448 ssl crt /usr/local/etc/haproxy/certs