trying to use NGINX as a forward proxy for QUIC.
The goal is that QUIC will identify the proxy address as the source rather than the sender.
Found this config as a reverse proxy. No problem with converting it to a forward proxy.
But how would one set the “source address” to the proxy rather than the sender? Is there some sort of header to change? Is it the same header as HTTP? Or is there a completely different way to change the “Source IP”?
http {
# Define a map to set the destination based on X-DATA-TYPE
map $http_x_data_type $destination {
default "invalid";
a http://svc-a.default.svc.cluster.local:8888;
b http://svc-b.default.svc.cluster.local:8888;
}
server {
# Enables routing of QUIC packets using eBPF
quic_gso on;
# Enable QUIC and HTTP/3.
listen 443 quic reuseport;
ssl_certificate cert.crt;
ssl_certificate_key cert.key;
# Enable all TLS versions (TLSv1.3 is required for QUIC).
ssl_protocols TLSv1 TLSv1.1 TLSv1.2 TLSv1.3;
location / {
# Add Alt-Svc header to negotiate HTTP/3.
add_header alt-svc 'h3=":443"; ma=86400';
# Check if $destination is set to an invalid value
if ($destination = "invalid") {
return 400;
}
# Use the $destination variable for valid proxy_pass
if ($destination != "invalid") {
proxy_pass $destination;
}
}
}
}
Link to this configuration (from a ServerFault post)
1