Faciliter la traversée réseau #37

Closed
opened 2024-09-29 17:32:26 +02:00 by neox · 2 comments
Owner

Répliquer ce qui a été fait côté infra (cominfra/xmpp#21) et lié à cominfra/infra-generale#199

Répliquer ce qui a été fait côté infra (https://forge.a-lec.org/cominfra/xmpp/issues/21) et lié à https://forge.a-lec.org/cominfra/infra-generale/issues/199
neox added the
en cours
label 2024-09-29 17:32:36 +02:00
Author
Owner

Configuration effectuée

Configuration effectuée
neox added
résolu
and removed
en cours
labels 2024-09-29 19:34:10 +02:00
Author
Owner

Configuration nginx ajoutée :

stream {

    # Définition du format de log avec ALPN
    log_format stream_logs '$remote_addr [$time_local] '
                          '$ssl_preread_server_name '
                          '$ssl_preread_alpn_protocols '
                          'proxy_pass=$upstream '
                          'bytes_sent=$bytes_sent bytes_received=$bytes_received '
                          'session_time=$session_time';

    error_log /var/log/nginx/stream-error.log;

    # Upstreams pour les différents backends
    upstream httpserver {
        server 127.0.0.1:8443;
    }

    upstream xmpps_proxy {
        server 127.0.0.1:5225;
    }

    upstream xmpp_http_proxy {
        server 127.0.0.1:5445;
    }

    # Mapping ALPN pour le domaine xmpp.a-lec.org
    map $ssl_preread_alpn_protocols $alpn_upstream {
        "xmpp-client" xmpps_proxy;
        default $upstream;
    }

    # Mapping du domaine SNI (Server Name Indication)
    map $ssl_preread_server_name $upstream {
        default httpserver;
        "proxy.chalec.org" xmpp_http_proxy;
        "proxy.bourmault.org" xmpp_http_proxy;
        "proxy.echolib.re" xmpp_http_proxy;
        "proxy.miaoulec.org" xmpp_http_proxy;
    }

    # Serveur principal qui écoute en IPv6
    server {
        listen [::]:443 ipv6only=on;
        proxy_pass $alpn_upstream;
        ssl_preread on;
        proxy_protocol on;

        access_log /var/log/nginx/stream-access6.log stream_logs;
    }
}
Configuration nginx ajoutée : ``` stream { # Définition du format de log avec ALPN log_format stream_logs '$remote_addr [$time_local] ' '$ssl_preread_server_name ' '$ssl_preread_alpn_protocols ' 'proxy_pass=$upstream ' 'bytes_sent=$bytes_sent bytes_received=$bytes_received ' 'session_time=$session_time'; error_log /var/log/nginx/stream-error.log; # Upstreams pour les différents backends upstream httpserver { server 127.0.0.1:8443; } upstream xmpps_proxy { server 127.0.0.1:5225; } upstream xmpp_http_proxy { server 127.0.0.1:5445; } # Mapping ALPN pour le domaine xmpp.a-lec.org map $ssl_preread_alpn_protocols $alpn_upstream { "xmpp-client" xmpps_proxy; default $upstream; } # Mapping du domaine SNI (Server Name Indication) map $ssl_preread_server_name $upstream { default httpserver; "proxy.chalec.org" xmpp_http_proxy; "proxy.bourmault.org" xmpp_http_proxy; "proxy.echolib.re" xmpp_http_proxy; "proxy.miaoulec.org" xmpp_http_proxy; } # Serveur principal qui écoute en IPv6 server { listen [::]:443 ipv6only=on; proxy_pass $alpn_upstream; ssl_preread on; proxy_protocol on; access_log /var/log/nginx/stream-access6.log stream_logs; } } ```
neox closed this issue 2024-10-09 22:06:10 +02:00
Sign in to join this conversation.
No description provided.