nginx negotiates X25519MLKEM768 by default only when it is linked against OpenSSL 3.5 or newer, because the default ssl_ecdh_curve auto hands the choice to OpenSSL and OpenSSL 3.5 prefers hybrid ML-KEM groups. If your nginx is linked against OpenSSL 3.0 to 3.4, you need a newer build first; no nginx setting can add the group on its own.
Enable it
If you have never set ssl_ecdh_curve, you are done once nginx runs on OpenSSL 3.5+. To make the order explicit, put this in the http block or in each server block that listens with ssl:
ssl_protocols TLSv1.2 TLSv1.3;
ssl_ecdh_curve X25519MLKEM768:X25519:prime256v1;
This lists the hybrid group first and keeps X25519 and P-256 for clients that do not support ML-KEM. Reload with nginx -t && nginx -s reload.
If you also serve an ECDSA certificate on P-384, add secp384r1 to the list. The nginx docs note that the curve list must include the curves your certificates use.
Check it worked
From a machine with an OpenSSL 3.5 or newer client:
openssl s_client -connect example.com:443 -servername example.com \
-groups X25519MLKEM768 -tls1_3 </dev/null 2>/dev/null | grep -i "group"
A working server prints Negotiated TLS1.3 group: X25519MLKEM768. To see the group per request in your logs, add the $ssl_curve variable to a log_format.
Run a free check at https://isquantumsafe.net/ to see the negotiated group and your grade.