45 lines
1.3 KiB
Nginx Configuration File
45 lines
1.3 KiB
Nginx Configuration File
map $ssl_client_s_dn $client_identity_allowed {
|
|
default 0;
|
|
~^CN=messenger-(api|worker|dispatcher)$ 1;
|
|
}
|
|
|
|
upstream otel_receiver {
|
|
zone otel_receiver 64k;
|
|
server otel-collector:4318;
|
|
keepalive 16;
|
|
}
|
|
|
|
proxy_temp_path /tmp/nginx-proxy-temp 1 2;
|
|
|
|
server {
|
|
listen 4318 ssl;
|
|
server_name otel-gateway;
|
|
access_log /dev/stdout;
|
|
error_log /dev/stderr warn;
|
|
|
|
ssl_certificate /run/secrets/otel-gateway.crt;
|
|
ssl_certificate_key /run/secrets/otel-gateway.key;
|
|
ssl_client_certificate /run/secrets/internal-ca.crt;
|
|
ssl_verify_client on;
|
|
ssl_verify_depth 1;
|
|
ssl_protocols TLSv1.2 TLSv1.3;
|
|
ssl_session_tickets off;
|
|
|
|
if ($client_identity_allowed = 0) { return 403; }
|
|
client_max_body_size 4m;
|
|
client_body_temp_path /tmp/nginx-client-body 1 2;
|
|
|
|
location ~ ^/v1/(traces|metrics|logs)$ {
|
|
proxy_pass https://otel_receiver;
|
|
proxy_http_version 1.1;
|
|
proxy_set_header Connection "";
|
|
proxy_ssl_server_name on;
|
|
proxy_ssl_name otel-collector;
|
|
proxy_ssl_verify on;
|
|
proxy_ssl_trusted_certificate /run/secrets/internal-ca.crt;
|
|
proxy_ssl_certificate /run/secrets/otel-client.crt;
|
|
proxy_ssl_certificate_key /run/secrets/otel-client.key;
|
|
}
|
|
location / { return 404; }
|
|
}
|