# HG changeset patch
# User Kim Alvefur <zash@zash.se>
# Date 1642256021 -3600
# Node ID 94253e02d47d78636f68bace40bf889f13b28eca
# Parent  7f25ac9d8f0d919b7afd6fb417ba3a8749eed13b
mod_http: Limit unencrypted http port (5280) to loopback by default

Since accessing this port directly over the wider Internet is unlikely
to intentional anymore.  Most uses will likely be by reverse proxies, by
mistake or because of trouble configuring HTTPS.

Blocking mistaken uses is just a good thing, letting users send
potentially private things unencrypted tends to be Strongly Discouraged
these days.

Many reverse proxy setups operate over loopback, so listening there
instead of all interfaces is a net improvement.

Improved automatic certificate location and SNI support has mostly
eliminated the need for manual certificate configuration so HTTPS should
Just Work once certificates have been provided.

For local testing during development, connecting over loopback is likely
fine as well. When really needed, `http_interfaces` can still be set.

Suggested by Link Mauve

diff -r 7f25ac9d8f0d -r 94253e02d47d CHANGES
--- a/CHANGES	Sat Jan 15 09:09:24 2022 +0100
+++ b/CHANGES	Sat Jan 15 15:13:41 2022 +0100
@@ -32,6 +32,7 @@
 -   Direct TLS (including https) certificates updated on reload
 -   Pluggable authorization providers (mod_authz_)
 -   Easy use of Mozilla TLS recommendations presets
+-   Unencrypted HTTP port (5280) restricted to loopback by default
 
 ### HTTP
 
diff -r 7f25ac9d8f0d -r 94253e02d47d plugins/mod_http.lua
--- a/plugins/mod_http.lua	Sat Jan 15 09:09:24 2022 +0100
+++ b/plugins/mod_http.lua	Sat Jan 15 15:13:41 2022 +0100
@@ -304,6 +304,7 @@
 module:provides("net", {
 	name = "http";
 	listener = server.listener;
+	private = true;
 	default_port = 5280;
 	multiplex = {
 		pattern = "^[A-Z]";