This PR fixes delays when IPv6 DNS lookups stall otherwise working IPv4 connections.
The earlier changes ([04c74877](04c74877c3) and [8a6f7784](8a6f778410)) added fallback across available IPv4 and IPv6 addresses, which this PR preserves.
Resolving both families upfront appears to have been an implementation choice, yet now IPv6 is resolved only when no IPv4 connection succeeds.
Unit tests and real socket compatibility tests passed on Alma 10 and Debian 13.
ⓘ Prevent certificate-chain errors from being overwritten while preserving password-login fallback for invalid optional certificates.
Reset verification state for every TLS handshake and add regression coverage.
This PR stops treating `rpc=0` as a safe-user restriction, restoring File Manager ops and admin features for fully privileged accounts created with RPC disabled.
Preserve explicit `_safe` restrictions and product roles.
Regression tests and Perl syntax checks pass.
Fixes https://github.com/webmin/webmin/issues/2837
This PR adds a "Redirect all requests" option to the server block and location URL Re-Writing pages in the Nginx Webserver module, backed by the Nginx return directive with a choice of 301, 302, 303, 307 or 308.
The existing rewrite table only offers the redirect and permanent flags, which map to 302 and 301. The other codes requested on the forum are not supported by rewrite at all, so they can only be provided through return.
The new option only manages return directives that are redirects. A bare URL form such as return https://example.com/; is shown as a 302, while non-redirect uses like return 404; are hidden from the page and never modified or removed.
Example of the resulting config for a server block:
return 308 "https://example.com$request_uri";
Fixes https://forum.virtualmin.com/t/137940
ⓘ Values with a # were written unquoted, so on the next read the module took the # as the start of a comment and lost the rest of the line.
For example, a redirect saved as return 301 https://example.com/docs#install; then showed as no redirect on the page, and re-saving it added a duplicate rewrite_log directive that Nginx rejected.
So, before the fix, saving a redirect to https://example.com/docs#install wrote:
return 301 https://example.com/docs#install;
rewrite_log off;
On the next read the module dropped everything after the #, so it saw one merged line:
return 301 https://example.com/docs rewrite_log off;
The redirect disappeared from the page, and saving again appended a second rewrite_log off;, which Nginx rejects as a duplicate.
After the fix the same save writes:
return 301 "https://example.com/docs#install";
rewrite_log off;
Nginx treats the quoted and unquoted forms identically, and the module reads it back correctly.