SYSTEM INFORMATION
OS type and version
Debian 13
Webmin version
2.660
Hello,
as per title, is it possible to add the following return code 303-308 to the URL Re-Writing page of the Server Block Settings section in the nginx webmin module ?
Thanks,
Bye
Ilia
September 7, 2026, 2:15am
2
Hello,
Thanks for the suggestion. It was implemented in this PR and will be included in the next Webmin release:
master ← dev/nginx-add-return-code-redirects
opened 02:13AM - 07 Sep 26 UTC
Hi Jamie,
This PR adds a "Redirect all requests" option to the server block a… nd 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](https://forum.virtualmin.com/t/new-nginx-module-server-block-settings-url-re-writing-return-code-303-308/137940) 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. The target can be a path or a full URL, and the field shows an example of each as a placeholder.
Example of the resulting config for a server block:
```
return 308 "https://example.com$request_uri";
```