<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <title>Pages - Recent updates</title>
    <link>https://www.muffetlab.com/rss/page</link>
    <pubDate>Tue, 17 Nov 2026 03:18:20 -0600</pubDate>
    <generator>KohanaPHP</generator>
    <item>
      <guid>http://www.muffetlab.com/3</guid>
      <title>Rejecting Unknown SNI with Nginx</title>
      <link>https://www.muffetlab.com/pages/rejecting-unknown-sni-with-nginx</link>
      <author>Tinsh</author>
      <description>&lt;h1&gt;&lt;code&gt;ssl_reject_handshake&lt;/code&gt;&lt;/h1&gt;
&lt;p&gt;When using Nginx's &lt;code&gt;stream&lt;/code&gt; module to route HTTPS traffic based on Server Name Indication (SNI), unknown hostnames should be rejected as early as possible.&lt;/p&gt;
&lt;p&gt;A common approach is to forward unmatched SNI requests to a default HTTPS server and use &lt;code&gt;return 444&lt;/code&gt; to close the connection. However, Nginx provides a more efficient solution: &lt;code&gt;ssl_reject_handshake on&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;This article explains the configuration and why it is a better fit for this scenario.&lt;/p&gt;
&lt;h2&gt;1. Architecture&lt;/h2&gt;
&lt;p&gt;The setup uses the Nginx &lt;code&gt;stream&lt;/code&gt; module to inspect TLS ClientHello messages and route connections according to their SNI hostname.&lt;/p&gt;
&lt;pre&gt;&nbsp;&lt;/pre&gt;
&lt;p&gt;stream {&lt;br&gt;&nbsp; &nbsp; map $ssl_preread_server_name $stream_map {&lt;br&gt;&nbsp; &nbsp; &nbsp; &nbsp; example.com ...</description>
      <pubDate>Tue, 17 Nov 2026 03:18:20 -0600</pubDate>
    </item>
  </channel>
</rss>
